diff options
-rw-r--r-- | src/stages/compiler.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/stages/compiler.rs b/src/stages/compiler.rs index 9d16bf0..87618ff 100644 --- a/src/stages/compiler.rs +++ b/src/stages/compiler.rs @@ -57,8 +57,8 @@ impl SymbolParser { } } - fn record_symbol(&mut self, name: &str, source: &SourceSpan, role: SymbolRole) { - let name = name.to_string(); + fn record_symbol(&mut self, name: &str, arg_count: usize, source: &SourceSpan, role: SymbolRole) { + let name = format!("{name}:{arg_count}"); let namespace = match &self.macro_name { Some(macro_name) => vec![macro_name.to_owned()], None => vec![], @@ -76,6 +76,7 @@ impl SymbolParser { // Record macro definition. self.record_symbol( &definition.name, + definition.arguments.len(), &definition.name.source, Definition(MustPrecedeReference), ); @@ -84,6 +85,7 @@ impl SymbolParser { for argument in &definition.arguments { self.record_symbol( &argument.name, + 0, &argument.source, Definition(MustPrecedeReference), ); @@ -132,6 +134,7 @@ impl SymbolParser { fn parse_invocation(&mut self, invocation: &Invocation, source: &SourceSpan) { self.record_symbol( &invocation.name, + invocation.arguments.len(), &source, Reference, ); @@ -160,6 +163,7 @@ impl SymbolParser { BlockToken::LabelDefinition(name) => { self.record_symbol( &name, + 0, &source, Definition(CanFollowReference), ); @@ -175,6 +179,7 @@ impl SymbolParser { for field in &word_template.fields { self.record_symbol( &field.name.to_string(), + 0, &field.source, Reference, ); |