diff --git a/src/protocol/parser/symbol_table.rs b/src/protocol/parser/symbol_table.rs index 3ccccbf39484153d2908a57e5adf0d62fd694749..007eb112b223f81bc9ffa940a89f5c2b6ce7e832 100644 --- a/src/protocol/parser/symbol_table.rs +++ b/src/protocol/parser/symbol_table.rs @@ -135,7 +135,7 @@ impl SymbolVariant { } /// TODO: @Cleanup - remove clone everywhere -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct Symbol { pub name: StringRef<'static>, pub variant: SymbolVariant, @@ -191,6 +191,8 @@ impl SymbolTable { ); debug_assert!(!self.scope_lookup.contains_key(&new_scope), "inserting scope {:?}, but it already exists", new_scope); + println!("DEBUG: Inserting scope {:?} with parent {:?}", new_scope, parent_scope); + if let Some(parent_scope) = parent_scope { let parent = self.scope_lookup.get_mut(&parent_scope).unwrap(); parent.child_scopes.push(new_scope); @@ -212,6 +214,7 @@ impl SymbolTable { // Note: we do not return a reference because Rust doesn't like it. pub(crate) fn insert_symbol(&mut self, in_scope: SymbolScope, symbol: Symbol) -> Result<(), (Symbol, Symbol)> { debug_assert!(self.scope_lookup.contains_key(&in_scope), "inserting symbol {}, but scope {:?} does not exist", symbol.name.as_str(), in_scope); + println!("DEBUG: Inserting symbol {:?} in scope {:?}", symbol, in_scope); let mut seek_scope = in_scope; loop { let scoped_symbols = self.scope_lookup.get(&seek_scope).unwrap();