From cc1b2d971bd1afc430756ded20e8c24d98fb4b9b Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 13 Oct 2025 13:35:45 +1300 Subject: Rename labels/sublabels to global/local labels This terminology has been used in the manual for a long time now. --- src/stages/semantic.rs | 4 ++-- src/stages/semantic_tokens.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/stages/semantic.rs b/src/stages/semantic.rs index 6cd83f8..eb9e7b6 100644 --- a/src/stages/semantic.rs +++ b/src/stages/semantic.rs @@ -45,7 +45,7 @@ impl SemanticParser { match symbol { ScopedSymbol::Global(name) => match &self.namespace { Namespace::Macro(_) => { - let error = SemanticError::LabelInMacroDefinition; + let error = SemanticError::GlobalLabelInMacroDefinition; self.errors.push(Tracked::from(error, source.to_owned())); None } @@ -62,7 +62,7 @@ impl SemanticParser { Some(format!("{label_ns}/{name}")) } Namespace::None => { - let error = SemanticError::SublabelWithoutNamespace; + let error = SemanticError::LocalLabelWithoutNamespace; self.errors.push(Tracked::from(error, source.to_owned())); None } diff --git a/src/stages/semantic_tokens.rs b/src/stages/semantic_tokens.rs index ab50fb1..2cb67a7 100644 --- a/src/stages/semantic_tokens.rs +++ b/src/stages/semantic_tokens.rs @@ -101,8 +101,8 @@ pub enum SemanticError { InvalidArgumentDefinition, InvalidInvocationArgument, - LabelInMacroDefinition, - SublabelWithoutNamespace, + GlobalLabelInMacroDefinition, + LocalLabelWithoutNamespace, LocalSymbolWithoutNamespace, } @@ -170,10 +170,10 @@ fn report_semantic_error(error: &Tracked, source_code: &str) { SemanticError::InvalidInvocationArgument => "This token cannot be used in an invocation argument", - SemanticError::LabelInMacroDefinition => - &format!("Only sublabels can be defined inside macro definitions"), - SemanticError::SublabelWithoutNamespace => - &format!("Sublabel was not defined inside a macro definition or after a label"), + SemanticError::GlobalLabelInMacroDefinition => + &format!("Macro definitions cannot contain global labels"), + SemanticError::LocalLabelWithoutNamespace => + &format!("Local label was not defined inside a macro definition or after a label"), SemanticError::LocalSymbolWithoutNamespace => &format!("Local symbol was not defined inside a macro definition or after a label"), }; -- cgit v1.2.3-70-g09d2