mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
first steps for init
This commit is contained in:
parent
352008e8a0
commit
b6ceaab341
5 changed files with 54 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,18 @@ pub fn dict_empty<'a, 'ctx, 'env>(
|
|||
zig_dict_to_struct(env, result).into()
|
||||
}
|
||||
|
||||
pub fn dict_insert<'a, 'ctx, 'env>(
|
||||
_env: &Env<'a, 'ctx, 'env>,
|
||||
_scope: &Scope<'a, 'ctx>,
|
||||
_dict: BasicValueEnum<'ctx>,
|
||||
_key: BasicValueEnum<'ctx>,
|
||||
_key_layout: &Layout<'a>,
|
||||
_value: BasicValueEnum<'ctx>,
|
||||
_value_layout: &Layout<'a>,
|
||||
) -> BasicValueEnum<'ctx> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn dict_symbol_to_i128<'a, 'ctx, 'env>(
|
||||
env: &Env<'a, 'ctx, 'env>,
|
||||
scope: &Scope<'a, 'ctx>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue