summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-10-13 13:35:45 +1300
committerBen Bridle <ben@derelict.engineering>2025-10-13 13:36:18 +1300
commitcc1b2d971bd1afc430756ded20e8c24d98fb4b9b (patch)
tree6fcb8868cfad7c71fdcd93e828537c659b3154e5
parent73ab590c4420e051afba4a501c1dcb4fb99baeec (diff)
downloadtorque-asm-cc1b2d971bd1afc430756ded20e8c24d98fb4b9b.zip
Rename labels/sublabels to global/local labels
This terminology has been used in the manual for a long time now.
-rw-r--r--src/stages/semantic.rs4
-rw-r--r--src/stages/semantic_tokens.rs12
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<SemanticError>, 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"),
};