aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 06:10:05 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 06:10:05 +0000
commit43451328a5ae74ffa34356259ee02e3786f070c3 (patch)
tree8415ddf9af1ab030f36f9aee13e5f644b671862e /lib
parentbc990a0917b401e16a0ab57affd868d5ef51cdec (diff)
fix(parser): accept optional DO after WHILE condition
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Parser/ParserControlFlow.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parser/ParserControlFlow.cc b/lib/Parser/ParserControlFlow.cc
index afa8bd8..1cbedcd 100644
--- a/lib/Parser/ParserControlFlow.cc
+++ b/lib/Parser/ParserControlFlow.cc
@@ -54,6 +54,8 @@ std::unique_ptr<StmtAST> Parser::ParseWhileStmt() {
auto Cond = ParseExpression();
if (!Cond) return nullptr;
+ if (CurTok == tok_identifier && Lex.IdentifierStr == "DO") getNextToken();
+
std::vector<std::unique_ptr<StmtAST>> Body = ParseBlock({tok_endwhile});
if (CurTok != tok_endwhile) {