mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-21 21:01:15 +01:00
Rename Expr_List to Expr_AssignList
This commit is contained in:
parent
43f9c37c7f
commit
9ed77427a2
@ -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
|
||||
|
26
lib/PHPParser/Node/Expr/AssignList.php
Normal file
26
lib/PHPParser/Node/Expr/AssignList.php
Normal 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
|
||||
);
|
||||
}
|
||||
}
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user