class def
This commit is contained in:
parent
5f560f079b
commit
878dfe74e0
4 changed files with 14 additions and 6 deletions
|
|
@ -94,9 +94,18 @@ stmt:
|
|||
| KW_RETURN expr NEWLINE {
|
||||
$$ = std::make_unique<Return>(std::move($2));
|
||||
}
|
||||
| KW_RETURN NEWLINE {
|
||||
$$ = std::make_unique<Return>(nullptr);
|
||||
}
|
||||
| KW_PASS NEWLINE {
|
||||
$$ = std::make_unique<Pass>();
|
||||
}
|
||||
| KW_WHILE expr COLON NEWLINE INDENT stmt_list DEDENT {
|
||||
$$ = std::make_unique<While>(std::move($2), std::move($6));
|
||||
}
|
||||
| KW_CLASS IDENTIFIER COLON NEWLINE INDENT stmt_list DEDENT {
|
||||
$$ = std::make_unique<ClassDef>(std::move($2), std::move($6));
|
||||
}
|
||||
;
|
||||
|
||||
expr:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue