aboutsummaryrefslogtreecommitdiff
path: root/lib/Parser/Parser.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-16 10:09:47 +0000
committer_ov4 <ov4@ov4.org>2026-10-16 10:09:47 +0000
commite2c65706e61be09ddb7eeb28cd1957acd4317bcf (patch)
tree15447a03d67d395a722c5be3f0b05bc9f197197a /lib/Parser/Parser.cc
parent45c9d37eb27d204a6202b33cb37e890af0171357 (diff)
feat(constants): implement literal constants with lexical scope
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser/Parser.cc')
-rw-r--r--lib/Parser/Parser.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parser/Parser.cc b/lib/Parser/Parser.cc
index 58422fc..d8fecdc 100644
--- a/lib/Parser/Parser.cc
+++ b/lib/Parser/Parser.cc
@@ -45,7 +45,7 @@ std::vector<std::unique_ptr<StmtAST>> Parser::Parse() {
void Parser::syncToStatementStart() {
while (CurTok != tok_eof) {
switch (CurTok) {
- case tok_declare: case tok_identifier: case tok_input: case tok_output:
+ case tok_constant: case tok_declare: case tok_identifier: case tok_input: case tok_output:
case tok_case: case tok_endcase: case tok_otherwise:
case tok_if: case tok_while: case tok_repeat: case tok_for:
case tok_function: case tok_procedure: case tok_call: case tok_return:
@@ -98,6 +98,7 @@ std::unique_ptr<StmtAST> Parser::ParseStatementImpl() {
getNextToken();
return nullptr;
}
+ if (CurTok == tok_constant) return ParseConstant();
if (CurTok == tok_declare) {
return ParseDeclare();
}