first steps for init

This commit is contained in:
Folkert 2021-02-09 22:47:38 +01:00
parent 352008e8a0
commit b6ceaab341
5 changed files with 54 additions and 1 deletions

View file

@ -1,4 +1,4 @@
use crate::llvm::build_dict::{dict_empty, dict_len};
use crate::llvm::build_dict::{dict_empty, dict_insert, dict_len};
use crate::llvm::build_hash::hash;
use crate::llvm::build_list::{
allocate_list, empty_list, empty_polymorphic_list, list_append, list_concat, list_contains,
@ -3998,6 +3998,14 @@ fn run_low_level<'a, 'ctx, 'env>(
debug_assert_eq!(args.len(), 0);
dict_empty(env, scope)
}
DictInsert => {
debug_assert_eq!(args.len(), 3);
let (dict, _) = load_symbol_and_layout(scope, &args[0]);
let (key, key_layout) = load_symbol_and_layout(scope, &args[1]);
let (value, value_layout) = load_symbol_and_layout(scope, &args[2]);
dict_insert(env, scope, dict, key, key_layout, value, value_layout)
}
}
}