mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-22 05:11:39 +01:00
Fix incorrect Node creation for dynamic static property access
This commit is contained in:
parent
02a1c63aed
commit
685171ddc5
@ -687,9 +687,9 @@ variable_without_objects:
|
||||
base_variable:
|
||||
variable_without_objects { $$ = $1; }
|
||||
| class_name T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => new Node_Variable(array('name' => $4)))); }
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => $4)); }
|
||||
| reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => new Node_Variable(array('name' => $4)))); }
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => $4)); }
|
||||
| static_property_with_arrays { $$ = $1; }
|
||||
;
|
||||
|
||||
@ -697,7 +697,7 @@ static_property_with_arrays:
|
||||
class_name T_PAAMAYIM_NEKUDOTAYIM T_VARIABLE
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => substr($3, 1))); }
|
||||
| reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}'
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => new Node_Variable(array('name' => $5)))); }
|
||||
{ $$ = new Node_Expr_StaticPropertyFetch(array('class' => $1, 'name' => $5)); }
|
||||
| static_property_with_arrays '[' dim_offset ']' { $$ = new Node_Expr_ArrayDimFetch(array('var' => $1, 'dim' => $3)); }
|
||||
| static_property_with_arrays '{' expr '}' { $$ = new Node_Expr_ArrayDimFetch(array('var' => $1, 'dim' => $3)); }
|
||||
;
|
||||
|
@ -687,9 +687,9 @@ variable_without_objects:
|
||||
base_variable:
|
||||
variable_without_objects { $$ = $1; }
|
||||
| class_name T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: Variable[name: $4]]; }
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $4]; }
|
||||
| reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: Variable[name: $4]]; }
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $4]; }
|
||||
| static_property_with_arrays { $$ = $1; }
|
||||
;
|
||||
|
||||
@ -697,7 +697,7 @@ static_property_with_arrays:
|
||||
class_name T_PAAMAYIM_NEKUDOTAYIM T_VARIABLE
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: parseVar($3)]; }
|
||||
| reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}'
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: Variable[name: $5]]; }
|
||||
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $5]; }
|
||||
| static_property_with_arrays '[' dim_offset ']' { $$ = Expr_ArrayDimFetch[var: $1, dim: $3]; }
|
||||
| static_property_with_arrays '{' expr '}' { $$ = Expr_ArrayDimFetch[var: $1, dim: $3]; }
|
||||
;
|
||||
|
@ -2721,11 +2721,11 @@ class Parser
|
||||
}
|
||||
|
||||
private function yyn314() {
|
||||
$this->yyval = new Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => new Node_Variable(array('name' => $this->yyastk[$this->yysp-(4-4)]))));
|
||||
$this->yyval = new Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => $this->yyastk[$this->yysp-(4-4)]));
|
||||
}
|
||||
|
||||
private function yyn315() {
|
||||
$this->yyval = new Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => new Node_Variable(array('name' => $this->yyastk[$this->yysp-(4-4)]))));
|
||||
$this->yyval = new Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => $this->yyastk[$this->yysp-(4-4)]));
|
||||
}
|
||||
|
||||
private function yyn316() {
|
||||
@ -2737,7 +2737,7 @@ class Parser
|
||||
}
|
||||
|
||||
private function yyn318() {
|
||||
$this->yyval = new Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(6-1)], 'name' => new Node_Variable(array('name' => $this->yyastk[$this->yysp-(6-5)]))));
|
||||
$this->yyval = new Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-5)]));
|
||||
}
|
||||
|
||||
private function yyn319() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user