mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Move load_symbol_and_layout to scope
This commit is contained in:
parent
6e23365551
commit
bbef63f28f
5 changed files with 54 additions and 59 deletions
|
@ -35,6 +35,16 @@ impl<'a, 'ctx> Scope<'a, 'ctx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn load_symbol_and_layout(
|
||||
&self,
|
||||
symbol: &Symbol,
|
||||
) -> (BasicValueEnum<'ctx>, InLayout<'a>) {
|
||||
match self.get(symbol) {
|
||||
Some((layout, ptr)) => (*ptr, *layout),
|
||||
None => panic!("There was no entry for {:?} in scope {:?}", symbol, self),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, symbol: Symbol, value: (InLayout<'a>, BasicValueEnum<'ctx>)) {
|
||||
self.symbols.insert(symbol, value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue