Rename Expr_List to Expr_AssignList

This commit is contained in:
nikic 2011-10-16 14:49:13 +02:00
parent 43f9c37c7f
commit 9ed77427a2
6 changed files with 31 additions and 31 deletions

View File

@ -441,7 +441,7 @@ for_expr:
expr:
variable { $$ = $1; }
| T_LIST '(' assignment_list ')' '=' expr { $$ = Expr_List[$3, $6]; }
| T_LIST '(' assignment_list ')' '=' expr { $$ = Expr_AssignList[$3, $6]; }
| variable '=' expr { $$ = Expr_Assign[$1, $3]; }
| variable '=' '&' variable { $$ = Expr_AssignRef[$1, $4]; }
| variable '=' '&' T_NEW class_name_reference ctor_arguments

View File

@ -0,0 +1,26 @@
<?php
/**
* @property array $vars List of variables to assign to
* @property PHPParser_Node_Expr $expr Expression
*/
class PHPParser_Node_Expr_AssignList extends PHPParser_Node_Expr
{
/**
* Constructs a list() assignment node.
*
* @param array $vars List of variables to assign to
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(array $vars, PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'vars' => $vars,
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1,26 +0,0 @@
<?php
/**
* @property array $assignList List of variables to assign to
* @property PHPParser_Node_Expr $expr Expression
*/
class PHPParser_Node_Expr_List extends PHPParser_Node_Expr
{
/**
* Constructs a list() assignment node.
*
* @param array $assignList List of variables to assign to
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(array $assignList, PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'assignList' => $assignList,
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1613,7 +1613,7 @@ class PHPParser_Parser
}
protected function yyn158($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_List($this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-6)], $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_AssignList($this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-6)], $line, $docComment);
}
protected function yyn159($line, $docComment) {

View File

@ -137,8 +137,8 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
return $this->p($node->var) . ' >>= ' . $this->p($node->expr);
}
public function pExpr_List(PHPParser_Node_Expr_List $node) {
return $this->pAssignList($node->assignList) . ' = ' . $this->p($node->expr);
public function pExpr_AssignList(PHPParser_Node_Expr_AssignList $node) {
return $this->pAssignList($node->vars) . ' = ' . $this->p($node->expr);
}
// Binary expressions

View File

@ -54,7 +54,7 @@ abstract class PHPParser_PrettyPrinterAbstract
'Expr_AssignBitwiseXor' => 15,
'Expr_AssignShiftLeft' => 15,
'Expr_AssignShiftRight' => 15,
'Expr_List' => 15,
'Expr_AssignList' => 15,
'Expr_LogicalAnd' => 16,
'Expr_LogicalXor' => 17,
'Expr_LogicalOr' => 18,