mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
Support recovery from Foo::
This commit is contained in:
parent
c5cdd5ad73
commit
e52ffc4447
@ -696,6 +696,10 @@ constant:
|
||||
name { $$ = Expr\ConstFetch[$1]; }
|
||||
| class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier
|
||||
{ $$ = Expr\ClassConstFetch[$1, $3]; }
|
||||
/* We interpret and isolated FOO:: as an unfinished class constant fetch. It could also be
|
||||
an unfinished static property fetch or unfinished scoped call. */
|
||||
| class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error
|
||||
{ $$ = Expr\ClassConstFetch[$1, Expr\Error[]]; $this->errorState = 2; }
|
||||
;
|
||||
|
||||
array_short_syntax:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -336,4 +336,38 @@ array(
|
||||
name: Expr_Error(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
Foo::$
|
||||
-----
|
||||
!!php7
|
||||
Syntax error, unexpected EOF, expecting T_VARIABLE or '{' or '$' from 2:7 to 2:7
|
||||
array(
|
||||
0: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
name: Expr_Error(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
Foo::
|
||||
-----
|
||||
!!php7
|
||||
Syntax error, unexpected EOF from 2:6 to 2:6
|
||||
array(
|
||||
0: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
name: Expr_Error(
|
||||
)
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue
Block a user