1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00

Fix pretty printing issues caused by Expr_InstanceOf vs Expr_Instanceof

This commit is contained in:
nikic 2011-06-04 15:25:54 +02:00
parent bf00dff2cf
commit 8294ceb754
5 changed files with 5 additions and 5 deletions

View File

@ -497,7 +497,7 @@ expr:
| expr T_IS_SMALLER_OR_EQUAL expr { $$ = new Node_Expr_SmallerOrEqual(array('left' => $1, 'right' => $3)); }
| expr '>' expr { $$ = new Node_Expr_Greater(array('left' => $1, 'right' => $3)); }
| expr T_IS_GREATER_OR_EQUAL expr { $$ = new Node_Expr_GreaterOrEqual(array('left' => $1, 'right' => $3)); }
| expr T_INSTANCEOF class_name_reference { $$ = new Node_Expr_InstanceOf(array('expr' => $1, 'class' => $3)); }
| expr T_INSTANCEOF class_name_reference { $$ = new Node_Expr_Instanceof(array('expr' => $1, 'class' => $3)); }
| '(' expr ')' { $$ = $2; }
| expr '?' expr ':' expr { $$ = new Node_Expr_Ternary(array('cond' => $1, 'if' => $3, 'else' => $5)); }
| expr '?' ':' expr { $$ = new Node_Expr_Ternary(array('cond' => $1, 'if' => null, 'else' => $4)); }

View File

@ -497,7 +497,7 @@ expr:
| expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr_SmallerOrEqual[left: $1, right: $3]; }
| expr '>' expr { $$ = Expr_Greater[left: $1, right: $3]; }
| expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr_GreaterOrEqual[left: $1, right: $3]; }
| expr T_INSTANCEOF class_name_reference { $$ = Expr_InstanceOf[expr: $1, class: $3]; }
| expr T_INSTANCEOF class_name_reference { $$ = Expr_Instanceof[expr: $1, class: $3]; }
| '(' expr ')' { $$ = $2; }
| expr '?' expr ':' expr { $$ = Expr_Ternary[cond: $1, if: $3, else: $5]; }
| expr '?' ':' expr { $$ = Expr_Ternary[cond: $1, if: null, else: $4]; }

View File

@ -4,6 +4,6 @@
* @property Node_Expr $expr Expression
* @property Node_Expr $class Class name
*/
class Node_Expr_InstanceOf extends Node_Expr
class Node_Expr_Instanceof extends Node_Expr
{
}

View File

@ -1862,7 +1862,7 @@ class Parser
}
private function yyn209() {
$this->yyval = new Node_Expr_InstanceOf(array('expr' => $this->yyastk[$this->yysp-(3-1)], 'class' => $this->yyastk[$this->yysp-(3-3)]));
$this->yyval = new Node_Expr_Instanceof(array('expr' => $this->yyastk[$this->yysp-(3-1)], 'class' => $this->yyastk[$this->yysp-(3-3)]));
}
private function yyn210() {

View File

@ -2264,7 +2264,7 @@ class ParserDebug
}
private function yyn209() {
$this->yyval = new Node_Expr_InstanceOf(array('expr' => $this->yyastk[$this->yysp-(3-1)], 'class' => $this->yyastk[$this->yysp-(3-3)]));
$this->yyval = new Node_Expr_Instanceof(array('expr' => $this->yyastk[$this->yysp-(3-1)], 'class' => $this->yyastk[$this->yysp-(3-3)]));
}
private function yyn210() {