mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Code compiles for load_str, but does not work
This commit is contained in:
parent
a318253d48
commit
89ca6735eb
2 changed files with 393 additions and 177 deletions
|
@ -1125,6 +1125,16 @@ pub fn load_symbol<'a, 'ctx, 'env>(
|
|||
}
|
||||
}
|
||||
|
||||
pub fn ptr_from_symbol<'a, 'ctx, 'scope>(
|
||||
scope: &'scope Scope<'a, 'ctx>,
|
||||
symbol: Symbol,
|
||||
) -> &'scope PointerValue<'ctx> {
|
||||
match scope.get(&symbol) {
|
||||
Some((_, ptr)) => ptr,
|
||||
None => panic!("There was no entry for {:?} in scope {:?}", symbol, scope),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_symbol_and_layout<'a, 'ctx, 'env, 'b>(
|
||||
env: &Env<'a, 'ctx, 'env>,
|
||||
scope: &'b Scope<'a, 'ctx>,
|
||||
|
@ -1546,11 +1556,7 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
// Str.concat : Str, Str -> Str
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
let first_str = load_symbol(env, scope, &args[0]);
|
||||
|
||||
let second_str = load_symbol(env, scope, &args[1]);
|
||||
|
||||
str_concat(env, parent, first_str, second_str)
|
||||
str_concat(env, scope, parent, args[0], args[1])
|
||||
}
|
||||
ListLen => {
|
||||
// List.len : List * -> Int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue