mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Wrap List_ in ArrayItem
This was correctly done for the 'key'=>list() form, but not for unkeyed nested lists.
This commit is contained in:
parent
68973aed1e
commit
3e158a2313
@ -939,7 +939,7 @@ list_expr_elements:
|
||||
|
||||
list_expr_element:
|
||||
variable { $$ = Expr\ArrayItem[$1, null, false]; }
|
||||
| list_expr { $$ = $1; }
|
||||
| list_expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
||||
| /* empty */ { $$ = null; }
|
||||
;
|
||||
|
||||
|
@ -823,7 +823,7 @@ list_expr_elements:
|
||||
|
||||
list_expr_element:
|
||||
variable { $$ = Expr\ArrayItem[$1, null, false]; }
|
||||
| list_expr { $$ = $1; }
|
||||
| list_expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
||||
| expr T_DOUBLE_ARROW variable { $$ = Expr\ArrayItem[$3, $1, false]; }
|
||||
| expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; }
|
||||
| /* empty */ { $$ = null; }
|
||||
|
@ -3035,7 +3035,7 @@ class Php5 extends \PhpParser\ParserAbstract
|
||||
}
|
||||
|
||||
protected function reduceRule523() {
|
||||
$this->semValue = $this->semStack[$this->stackPos-(1-1)];
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$this->stackPos-(1-1)], null, false, $this->startAttributeStack[$this->stackPos-(1-1)] + $this->endAttributes);
|
||||
}
|
||||
|
||||
protected function reduceRule524() {
|
||||
|
@ -2657,7 +2657,7 @@ class Php7 extends \PhpParser\ParserAbstract
|
||||
}
|
||||
|
||||
protected function reduceRule460() {
|
||||
$this->semValue = $this->semStack[$this->stackPos-(1-1)];
|
||||
$this->semValue = new Expr\ArrayItem($this->semStack[$this->stackPos-(1-1)], null, false, $this->startAttributeStack[$this->stackPos-(1-1)] + $this->endAttributes);
|
||||
}
|
||||
|
||||
protected function reduceRule461() {
|
||||
|
@ -246,17 +246,21 @@ array(
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_List(
|
||||
items: array(
|
||||
0: null
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_List(
|
||||
items: array(
|
||||
0: null
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
|
Loading…
Reference in New Issue
Block a user