Add symbol_table to scope_resolution

This commit is contained in:
greg 2019-09-09 18:12:14 -07:00
parent 418d77770f
commit b65779fb93
1 changed files with 4 additions and 1 deletions

View File

@ -12,8 +12,11 @@ fn evaluate_all_outputs(input: &str) -> Vec<Result<String, String>> {
let mut state = State::new(symbol_table);
let mut ast = crate::util::quick_ast(input);
state.symbol_table_handle.borrow_mut().add_top_level_symbols(&ast).unwrap();
let mut scope_resolver = crate::scope_resolution::ScopeResolver::new();
{
let t = &state.symbol_table_handle.borrow();
let mut scope_resolver = crate::scope_resolution::ScopeResolver::new(&t);
let _ = scope_resolver.resolve(&mut ast);
}
let reduced = ast.reduce(&state.symbol_table_handle.borrow());
let all_output = state.evaluate(reduced, true);