mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Break up arguments of insert
This commit is contained in:
parent
c57d254205
commit
bb3cfb9cd3
2 changed files with 6 additions and 6 deletions
|
@ -2435,7 +2435,7 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>(
|
|||
// access itself!
|
||||
// scope = scope.clone();
|
||||
|
||||
scope.insert(*symbol, (*layout, val));
|
||||
scope.insert(*symbol, *layout, val);
|
||||
stack.push(*symbol);
|
||||
}
|
||||
|
||||
|
@ -5233,7 +5233,7 @@ fn build_proc<'a, 'ctx>(
|
|||
// Add args to scope
|
||||
for (arg_val, (layout, arg_symbol)) in fn_val.get_param_iter().zip(args) {
|
||||
arg_val.set_name(arg_symbol.as_str(&env.interns));
|
||||
scope.insert(*arg_symbol, (*layout, arg_val));
|
||||
scope.insert(*arg_symbol, *layout, arg_val);
|
||||
}
|
||||
|
||||
let body = build_exp_stmt(
|
||||
|
|
|
@ -20,6 +20,10 @@ pub(crate) struct Scope<'a, 'ctx> {
|
|||
pub(crate) struct JoinPointNotFound;
|
||||
|
||||
impl<'a, 'ctx> Scope<'a, 'ctx> {
|
||||
pub fn insert(&mut self, symbol: Symbol, layout: InLayout<'a>, value: BasicValueEnum<'ctx>) {
|
||||
self.symbols.insert(symbol, (layout, value));
|
||||
}
|
||||
|
||||
pub fn load_symbol(&self, symbol: &Symbol) -> BasicValueEnum<'ctx> {
|
||||
match self.symbols.get(symbol) {
|
||||
Some((_, ptr)) => *ptr,
|
||||
|
@ -38,10 +42,6 @@ impl<'a, 'ctx> Scope<'a, 'ctx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, symbol: Symbol, value: (InLayout<'a>, BasicValueEnum<'ctx>)) {
|
||||
self.symbols.insert(symbol, value);
|
||||
}
|
||||
|
||||
pub fn insert_top_level_thunk(
|
||||
&mut self,
|
||||
symbol: Symbol,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue