summaryrefslogtreecommitdiff
path: root/src/report.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-02-28 13:23:20 +1300
committerBen Bridle <ben@derelict.engineering>2025-02-28 13:34:23 +1300
commitdba769e13ca5029643c6068e53fa34ae0fea8421 (patch)
tree47b45ecddaf08bcef19de29ad65206c34af85f53 /src/report.rs
parent1a810d036195395c182f6cd6e011b8fb868d9872 (diff)
downloadtorque-asm-dba769e13ca5029643c6068e53fa34ae0fea8421.zip
Implement string literals
String literals are treated as integers. If a string is passed as an integer argument to a packed binary literal, a new instance of the packed binary literal is invoked for every character in the string, with each character being passed to the packed binary literal as a Unicode character value.
Diffstat (limited to 'src/report.rs')
-rw-r--r--src/report.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/report.rs b/src/report.rs
index 2acdddc..a88de4f 100644
--- a/src/report.rs
+++ b/src/report.rs
@@ -61,8 +61,12 @@ pub fn report_syntactic_errors(syntactic_tokens: &[SyntacticToken], source_code:
let message = format!("Unterminated comment");
report_source_error!(&context, &message);
}
+ SyntacticParseError::UnterminatedString => {
+ let message = format!("Unterminated string");
+ report_source_error!(&context, &message);
+ }
SyntacticParseError::UnterminatedExpression => {
- let message = format!("Unterminated constant expression");
+ let message = format!("Unterminated assembler expression");
report_source_error!(&context, &message);
}
SyntacticParseError::LabelInMacroDefinition => {
@@ -184,6 +188,8 @@ fn report_assembler_error(error: &AssemblerError, source_code: &str) {
format!("Value of type integer was expected here"),
AssemblerErrorVariant::IntegerInBlock =>
format!("Integer in block"),
+ AssemblerErrorVariant::StringInExpression =>
+ format!("Expressions cannot contain strings"),
AssemblerErrorVariant::IncorrectArgumentCount(expected, received) =>
format!("Expected {expected} arguments, but received {received} instead"),
AssemblerErrorVariant::IncorrectArgumentType(expected, received) =>