diff --git a/src/bin/dmc/name_analysis.rs b/src/bin/dmc/name_analysis.rs index 26ff680..62851f9 100644 --- a/src/bin/dmc/name_analysis.rs +++ b/src/bin/dmc/name_analysis.rs @@ -31,7 +31,7 @@ pub fn name_analysis(paths: &Vec) -> Result<(), Box( diagnostics: &mut Vec, ) { node.for_each_child_mut(&mut |child| { - gather_node(child, symbol_table, fqn_context, diagnostics); + gather_node(child, symbol_table, fqn_context, diagnostics); }); } @@ -203,7 +203,7 @@ fn gather_node<'a>( AstNodeRefMut::ClosureParameter(closure_parameter) => { gather_closure_parameter(closure_parameter, symbol_table, fqn_context, diagnostics); } - _ => todo!() + _ => todo!(), } } @@ -475,7 +475,12 @@ fn gather_function<'a>( ); } symbol_table.push_scope(&format!("FunctionScope {}", function.identifier().name())); - gather_node(function.generics_mut(), symbol_table, fqn_context, diagnostics); + gather_node( + function.generics_mut(), + symbol_table, + fqn_context, + diagnostics, + ); gather_node( function.parameters_mut(), symbol_table, @@ -912,7 +917,12 @@ fn gather_member<'a>( diagnostics, ); } - gather_node(member.type_use_mut(), symbol_table, fqn_context, diagnostics); + gather_node( + member.type_use_mut(), + symbol_table, + fqn_context, + diagnostics, + ); } fn gather_variable_declaration<'a>( diff --git a/src/name_analysis/mod.rs b/src/name_analysis/mod.rs index f95fe5e..08c9988 100644 --- a/src/name_analysis/mod.rs +++ b/src/name_analysis/mod.rs @@ -27,6 +27,7 @@ use crate::name_analysis::first_pass::np1_compilation_unit; use crate::name_analysis::symbol_table::SymbolTable; use codespan_reporting::files::Files; use std::hash::Hash; +use crate::name_analysis::second_pass::nap2_compilation_unit; pub(self) mod fqn_context; mod gather; @@ -53,7 +54,7 @@ pub fn analyze_names<'a, F: Files<'a, FileId = usize, Name = String>>( // resolve symbols for compilation_unit in compilation_units { - // resolve_compilation_unit(compilation_unit, symbol_table, &mut diagnostics); + nap2_compilation_unit(compilation_unit, symbol_table, &mut diagnostics); } diagnostics.into() diff --git a/src/name_analysis/symbol_table/mod.rs b/src/name_analysis/symbol_table/mod.rs index 66aef8f..9ca54cb 100644 --- a/src/name_analysis/symbol_table/mod.rs +++ b/src/name_analysis/symbol_table/mod.rs @@ -377,14 +377,14 @@ impl SymbolTable { } Err(NoDefinition) } - + pub fn resolve_usable_by_fqn( &self, fqn: &str ) -> Result { todo!() } - + pub fn resolve_usable_star( &self, base_fqn: &str,