feat(furc/parser): add while statement

This commit is contained in:
2026-08-08 00:07:38 +02:00
parent 1db13b4e10
commit 7ebc27cab9
3 changed files with 26 additions and 1 deletions
+9
View File
@@ -46,6 +46,15 @@ stmt_node* parser::parse_stmt() {
}
return m_arena->allocate<if_stmt_node>(std::move(node));
}
case token::While: {
m_lexer.next_token();
eat_token(token::LParen);
while_stmt_node node;
node.cond = parse_expr();
eat_token(token::RParen);
node.body = parse_stmt();
return m_arena->allocate<while_stmt_node>(std::move(node));
}
default: break;
}