diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2025-04-17 16:37:45 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2025-04-17 16:37:45 +1200 |
commit | 6eb86dc668ccd3e3b263f5942ab4eef63f49a7db (patch) | |
tree | cc2c13630e75b3f6c1459b1288a6df0a6ea1706a /src/stages/syntactic_tokens.rs | |
parent | 9f9bc54fca071277cbe73b5e163c08d27e4da52a (diff) | |
download | torque-asm-6eb86dc668ccd3e3b263f5942ab4eef63f49a7db.zip |
Implement octal literals
Octal literals use the prefix '0o'.
Diffstat (limited to 'src/stages/syntactic_tokens.rs')
-rw-r--r-- | src/stages/syntactic_tokens.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stages/syntactic_tokens.rs b/src/stages/syntactic_tokens.rs index 041c568..5bfa0be 100644 --- a/src/stages/syntactic_tokens.rs +++ b/src/stages/syntactic_tokens.rs @@ -70,6 +70,7 @@ pub enum SyntacticError { InvalidDecimalLiteral(String), InvalidHexadecimalLiteral(String), InvalidBinaryLiteral(String), + InvalidOctalLiteral(String), } @@ -118,6 +119,8 @@ fn report_syntactic_error(error: &Tracked<SyntacticError>, source_code: &str) { &format!("The string '{string}' is not a valid hexadecimal literal"), SyntacticError::InvalidBinaryLiteral(string) => &format!("The string '{string}' is not a valid binary literal"), + SyntacticError::InvalidOctalLiteral(string) => + &format!("The string '{string}' is not a valid octal literal"), }; report_source_issue(LogLevel::Error, &context, message); |