Skip to content

Commit

Permalink
Support reserved keywords as enum cases
Browse files Browse the repository at this point in the history
Fixes #807.
  • Loading branch information
nikic committed Oct 17, 2021
1 parent 54f19a0 commit 4bfc459
Show file tree
Hide file tree
Showing 3 changed files with 343 additions and 329 deletions.
2 changes: 1 addition & 1 deletion grammar/php7.y
Expand Up @@ -688,7 +688,7 @@ class_statement:
{ $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]];
$this->checkClassMethod($$, #2); }
| T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; }
| optional_attributes T_CASE identifier enum_case_expr semi
| optional_attributes T_CASE identifier_ex enum_case_expr semi
{ $$ = Stmt\EnumCase[$3, $4, $1]; }
| error { $$ = null; /* will be skipped */ }
;
Expand Down

0 comments on commit 4bfc459

Please sign in to comment.