Skip to content

Commit

Permalink
Include trailing semicolon in GroupUse
Browse files Browse the repository at this point in the history
Fixes #1026.
  • Loading branch information
nikic committed Sep 21, 2024
1 parent 8d09ba8 commit aedfcc2
Show file tree
Hide file tree
Showing 5 changed files with 727 additions and 732 deletions.
6 changes: 3 additions & 3 deletions grammar/php.y
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ top_statement:
$this->checkNamespace($$); }
| T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; }
| T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; }
| group_use_declaration semi
| group_use_declaration
| T_CONST constant_declaration_list semi { $$ = Stmt\Const_[$2]; }
;

Expand All @@ -266,9 +266,9 @@ use_type:
;

group_use_declaration:
T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}'
T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' semi
{ $$ = Stmt\GroupUse[$3, $6, $2]; }
| T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
| T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' semi
{ $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; }
;

Expand Down
Loading

0 comments on commit aedfcc2

Please sign in to comment.