mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-26 20:14:46 +01:00
Merge branch '3.x'
Conflicts: lib/PhpParser/Parser/Php7.php
This commit is contained in:
commit
f291a19fd5
@ -775,7 +775,7 @@ constant:
|
||||
/* 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; }
|
||||
{ $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; }
|
||||
;
|
||||
|
||||
array_short_syntax:
|
||||
|
@ -129,10 +129,6 @@ class NameResolver extends NodeVisitorAbstract
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($node instanceof Node\NullableType) {
|
||||
if ($node->type instanceof Name) {
|
||||
$node->type = $this->resolveClassName($node->type);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -2086,7 +2086,7 @@ class Php7 extends \PhpParser\ParserAbstract
|
||||
$this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
||||
},
|
||||
419 => function ($stackPos) {
|
||||
$this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2;
|
||||
$this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2;
|
||||
},
|
||||
420 => function ($stackPos) {
|
||||
$attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT;
|
||||
|
@ -901,3 +901,36 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
|
||||
foo(Bar::);
|
||||
-----
|
||||
!!php7,positions
|
||||
Syntax error, unexpected ')' from 3:10 to 3:10
|
||||
array(
|
||||
0: Stmt_Expression[3:1 - 3:11](
|
||||
expr: Expr_FuncCall[3:1 - 3:10](
|
||||
name: Name[3:1 - 3:3](
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg[3:5 - 3:10](
|
||||
value: Expr_ClassConstFetch[3:5 - 3:10](
|
||||
class: Name[3:5 - 3:7](
|
||||
parts: array(
|
||||
0: Bar
|
||||
)
|
||||
)
|
||||
name: Expr_Error[3:10 - 3:10](
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue
Block a user