pora na 300+

This commit is contained in:
bronku 2025-11-30 11:41:42 +01:00
parent 878dfe74e0
commit a2fb31ab5a
5 changed files with 27 additions and 5 deletions

View file

@ -32,7 +32,7 @@
%left KW_OR
%left KW_AND
%right KW_NOT // unary logical NOT
%token KW_DEF KW_IF KW_RETURN KW_FOR KW_IN KW_PASS KW_ELSE KW_ELIF KW_CLASS KW_WHILE
%token KW_DEF KW_IF KW_RETURN KW_FOR KW_IN KW_PASS KW_ELSE KW_ELIF KW_CLASS KW_WHILE KW_BREAK KW_CONTINUE
%token L_PAREN R_PAREN L_BRACKET R_BRACKET L_BRACE R_BRACE
%token DOT COLON SEMICOLON COMMA
@ -100,6 +100,12 @@ stmt:
| KW_PASS NEWLINE {
$$ = std::make_unique<Pass>();
}
| KW_BREAK NEWLINE {
$$ = std::make_unique<Break>();
}
| KW_CONTINUE NEWLINE {
$$ = std::make_unique<Continue>();
}
| KW_WHILE expr COLON NEWLINE INDENT stmt_list DEDENT {
$$ = std::make_unique<While>(std::move($2), std::move($6));
}