Start on namespaces

This commit is contained in:
jhwgh1968
2020-05-03 12:19:01 -05:00
parent d83b829810
commit 7011e4068f
4 changed files with 74 additions and 4 deletions

View File

@@ -1180,7 +1180,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"))]
@@ -1489,6 +1490,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)?;