Remove some extraneous code

This commit is contained in:
greg 2019-10-16 10:39:48 -07:00
parent 7cabca2987
commit 92ad4767c8

View File

@ -10,14 +10,9 @@ type NameScopeStack<'t> = ScopeStack<'t, Rc<String>, FQSNPrefix>;
pub struct ScopeResolver<'a> { pub struct ScopeResolver<'a> {
symbol_table: &'a mut SymbolTable, symbol_table: &'a mut SymbolTable,
name_scope_stack: ScopeStack<'a, Rc<String>, FQSNPrefix>, name_scope_stack: ScopeStack<'a, Rc<String>, FQSNPrefix>,
errors: Vec<()>,
} }
impl<'a> ASTVisitor for ScopeResolver<'a> { impl<'a> ASTVisitor for ScopeResolver<'a> {
fn ast(&mut self, _ast: &AST) {
println!("VISITING AST!!!");
}
fn import(&mut self, import_spec: &ImportSpecifier) { fn import(&mut self, import_spec: &ImportSpecifier) {
let ImportSpecifier { ref path_components, ref imported_names, .. } = &import_spec; let ImportSpecifier { ref path_components, ref imported_names, .. } = &import_spec;
match imported_names { match imported_names {
@ -56,7 +51,7 @@ impl<'a> ASTVisitor for ScopeResolver<'a> {
use Pattern::*; use Pattern::*;
match pat { match pat {
Ignored => (), Ignored => (),
TuplePattern(patterns) => (), TuplePattern(_) => (),
Literal(_) => (), Literal(_) => (),
TupleStruct(name, _) => self.qualified_name_in_pattern(name), TupleStruct(name, _) => self.qualified_name_in_pattern(name),
Record(name, _) => self.qualified_name_in_pattern(name), Record(name, _) => self.qualified_name_in_pattern(name),
@ -68,11 +63,11 @@ impl<'a> ASTVisitor for ScopeResolver<'a> {
impl<'a> ScopeResolver<'a> { impl<'a> ScopeResolver<'a> {
pub fn new(symbol_table: &'a mut SymbolTable) -> ScopeResolver { pub fn new(symbol_table: &'a mut SymbolTable) -> ScopeResolver {
let name_scope_stack = ScopeStack::new(None); let name_scope_stack = ScopeStack::new(None);
ScopeResolver { symbol_table, name_scope_stack, errors: vec![] } ScopeResolver { symbol_table, name_scope_stack }
} }
pub fn resolve(&mut self, ast: &mut AST) -> Result<(), String> { pub fn resolve(&mut self, ast: &mut AST) -> Result<(), String> {
walk_ast(self, ast); walk_ast(self, ast);
Ok(()) //TODO make this error meaningful Ok(())
} }
//TODO this is incomplete //TODO this is incomplete