Fix AST for ClassName::$methodName()

This commit is contained in:
nikic 2011-10-20 22:16:25 +02:00
parent dc4182277f
commit aea2f67c52
2 changed files with 2 additions and 2 deletions

View File

@ -540,7 +540,7 @@ function_call:
{ $$ = Expr_StaticCall[$1, $3, $5]; }
| static_property_with_arrays '(' function_call_argument_list ')' {
if ($1 instanceof PHPParser_Node_Expr_StaticPropertyFetch) {
$$ = Expr_StaticCall[$1->class, $1->name, $3];
$$ = Expr_StaticCall[$1->class, Expr_Variable[$1->name], $3];
} elseif ($1 instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $1;
while ($tmp->var instanceof PHPParser_Node_Expr_ArrayDimFetch) {

View File

@ -1939,7 +1939,7 @@ class PHPParser_Parser
protected function yyn239($line, $docComment) {
if ($this->yyastk[$this->yysp-(4-1)] instanceof PHPParser_Node_Expr_StaticPropertyFetch) {
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(4-1)]->class, $this->yyastk[$this->yysp-(4-1)]->name, $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(4-1)]->class, new PHPParser_Node_Expr_Variable($this->yyastk[$this->yysp-(4-1)]->name, $line, $docComment), $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
} elseif ($this->yyastk[$this->yysp-(4-1)] instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $this->yyastk[$this->yysp-(4-1)];
while ($tmp->var instanceof PHPParser_Node_Expr_ArrayDimFetch) {