forked from Orchid/orchid
Converted Interner to work with Rc-s
- Interner no longer contains unsafe code - Tokens now hold a reference to the value they represent directly This will enable many future improvements
This commit is contained in:
@@ -30,8 +30,9 @@ pub fn run(expr: ExprInst, mut ctx: Context) -> Result<Return, RuntimeError> {
|
||||
i = clause.clone();
|
||||
},
|
||||
Clause::Constant(c) => {
|
||||
let symval = (ctx.symbols.get(c))
|
||||
.ok_or_else(|| RuntimeError::MissingSymbol(*c, loc.clone()))?;
|
||||
let symval = (ctx.symbols.get(c)).ok_or_else(|| {
|
||||
RuntimeError::MissingSymbol(c.clone(), loc.clone())
|
||||
})?;
|
||||
ctx.gas = ctx.gas.map(|g| g - 1); // cost of lookup
|
||||
i = symval.expr().clause.clone();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user