Merge branch 'namespace' of https://github.com/schungx/rhai into namespace

This commit is contained in:
Stephen Chung
2020-05-04 10:42:57 +08:00
4 changed files with 74 additions and 4 deletions

View File

@@ -1188,7 +1188,8 @@ impl Engine {
Some((index, ScopeEntryType::Normal)) => {
*scope.get_mut(index).0 = rhs_val;
Ok(Default::default())
}
},
Some((_, ScopeEntryType::Subscope)) => unreachable!(),
},
// idx_lhs[idx_expr] = rhs
#[cfg(not(feature = "no_index"))]
@@ -1497,6 +1498,11 @@ impl Engine {
Ok(Default::default())
}
// Import statement
Stmt::Import(_name_expr, _alias) => {
unimplemented!()
}
// Const statement
Stmt::Const(name, expr, _) if expr.is_constant() => {
let val = self.eval_expr(scope, state, fn_lib, expr, level)?;