for loops

This commit is contained in:
bronku 2025-11-28 12:53:02 +01:00
parent 9b4db724f1
commit 16cac369ee

View file

@ -77,6 +77,9 @@ stmt:
| KW_IF expr COLON NEWLINE INDENT stmt_list DEDENT KW_ELSE COLON NEWLINE INDENT stmt_list DEDENT{
$$ = std::make_unique<If>(std::move($2), std::move($6), std::move($12));
}
| KW_FOR IDENTIFIER KW_IN expr COLON NEWLINE INDENT stmt_list DEDENT {
$$ = std::make_unique<For> ($2, std::move($4), std::move($8));
}
;
expr: