Skip to content

Commit aedfcc2

Browse files
committed
Include trailing semicolon in GroupUse
Fixes nikic#1026.
1 parent 8d09ba8 commit aedfcc2

File tree

5 files changed

+727
-732
lines changed

5 files changed

+727
-732
lines changed

grammar/php.y

+3-3
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ top_statement:
256256
$this->checkNamespace($$); }
257257
| T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; }
258258
| T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; }
259-
| group_use_declaration semi
259+
| group_use_declaration
260260
| T_CONST constant_declaration_list semi { $$ = Stmt\Const_[$2]; }
261261
;
262262

@@ -266,9 +266,9 @@ use_type:
266266
;
267267

268268
group_use_declaration:
269-
T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}'
269+
T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' semi
270270
{ $$ = Stmt\GroupUse[$3, $6, $2]; }
271-
| T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
271+
| T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' semi
272272
{ $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; }
273273
;
274274

0 commit comments

Comments
 (0)