summaryrefslogtreecommitdiff
path: root/src/stages
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-10-14 16:53:46 +1300
committerBen Bridle <ben@derelict.engineering>2025-10-14 16:54:44 +1300
commita494bebe0adea18567548e1f8b43f679be2669b5 (patch)
tree146ad035db795523d3491397c12215bd7a836063 /src/stages
parentcc1b2d971bd1afc430756ded20e8c24d98fb4b9b (diff)
downloadtorque-asm-a494bebe0adea18567548e1f8b43f679be2669b5.zip
Update wording of syntactic and semantic errors
Diffstat (limited to 'src/stages')
-rw-r--r--src/stages/semantic_tokens.rs16
-rw-r--r--src/stages/syntactic_tokens.rs2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/stages/semantic_tokens.rs b/src/stages/semantic_tokens.rs
index 2cb67a7..f112f7f 100644
--- a/src/stages/semantic_tokens.rs
+++ b/src/stages/semantic_tokens.rs
@@ -150,13 +150,13 @@ fn report_semantic_error(error: &Tracked<SemanticError>, source_code: &str) {
let context = Context { source_code: &source_code, source: &error.source };
let message = match &error.value {
SemanticError::MisplacedStringLiteral =>
- "A string literal can only be used as an invocation argument",
+ "String literals can only be used as invocation arguments",
SemanticError::MisplacedListLiteral =>
- "A list literal can only be used as an invocation argument",
+ "List literals can only be used as invocation arguments",
SemanticError::MisplacedSeparator =>
- "A separator can only be used to construct an argument list",
+ "Separators can only be used for constructing an argument list",
SemanticError::MisplacedMacroDefinition =>
- "A macro definition must be used at the outermost level of the program",
+ "Macro definition must be placed at the outermost level of a program",
SemanticError::ExpectedInteger(location) =>
&format!("An integer value was expected {location}"),
@@ -166,16 +166,16 @@ fn report_semantic_error(error: &Tracked<SemanticError>, source_code: &str) {
&format!("A string value was expected {location}"),
SemanticError::InvalidArgumentDefinition =>
- "Argument definitions must be in the form name, {name}, or \"name\"",
+ "Argument definition must take one of the following forms: name, {name}, \"name\", or [name]",
SemanticError::InvalidInvocationArgument =>
"This token cannot be used in an invocation argument",
SemanticError::GlobalLabelInMacroDefinition =>
- &format!("Macro definitions cannot contain global labels"),
+ &format!("Macro definition cannot contain a global label"),
SemanticError::LocalLabelWithoutNamespace =>
- &format!("Local label was not defined inside a macro definition or after a label"),
+ &format!("Local label must be placed inside a macro definition or after a global label"),
SemanticError::LocalSymbolWithoutNamespace =>
- &format!("Local symbol was not defined inside a macro definition or after a label"),
+ &format!("Local symbol must be placed inside a macro definition or after a global label"),
};
report_source_issue(LogLevel::Error, &context, message);
diff --git a/src/stages/syntactic_tokens.rs b/src/stages/syntactic_tokens.rs
index 1f8db7f..273dfe5 100644
--- a/src/stages/syntactic_tokens.rs
+++ b/src/stages/syntactic_tokens.rs
@@ -110,7 +110,7 @@ fn report_syntactic_error(error: &Tracked<SyntacticError>, source_code: &str) {
"Attempted to terminate a macro definition, but no macro definition was in progress",
SyntacticError::ExpectedSingleCharacter =>
- "A character literal must contain exactly one character",
+ "Character literal must contain exactly one character",
SyntacticError::DuplicateFieldNameInWord(name) =>
&format!("The field '{name}' has already been used in this word"),