Skip to content

Commit 8a97fa1

Browse files
committed
Recover from missing semicolon after property or class const
Fixes nikic#712.
1 parent 1c13d05 commit 8a97fa1

File tree

3 files changed

+397
-267
lines changed

3 files changed

+397
-267
lines changed

grammar/php7.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,10 @@ class_statement_list:
630630
;
631631

632632
class_statement:
633-
optional_attributes variable_modifiers optional_type_without_static property_declaration_list ';'
633+
optional_attributes variable_modifiers optional_type_without_static property_declaration_list semi
634634
{ $$ = new Stmt\Property($2, $4, attributes(), $3, $1);
635635
$this->checkProperty($$, #2); }
636-
| optional_attributes method_modifiers T_CONST class_const_list ';'
636+
| optional_attributes method_modifiers T_CONST class_const_list semi
637637
{ $$ = new Stmt\ClassConst($4, $2, attributes(), $1);
638638
$this->checkClassConst($$, #2); }
639639
| optional_attributes method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body

0 commit comments

Comments
 (0)