mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-25 08:11:22 +02:00
Merge branch '3.x'
Conflicts: lib/PhpParser/Parser/Php5.php lib/PhpParser/Parser/Php7.php
This commit is contained in:
@@ -1317,7 +1317,14 @@ class Php5 extends \PhpParser\ParserAbstract
|
||||
throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
||||
},
|
||||
129 => function ($stackPos) {
|
||||
$this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments']) && isset($stmts[0])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); };
|
||||
|
||||
if ($this->semStack[$stackPos-(3-2)]) {
|
||||
$this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); };
|
||||
} else {
|
||||
$startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; };
|
||||
if (null === $this->semValue) { $this->semValue = array(); }
|
||||
}
|
||||
|
||||
},
|
||||
130 => function ($stackPos) {
|
||||
$this->semValue = new Stmt\If_($this->semStack[$stackPos-(5-2)], ['stmts' => is_array($this->semStack[$stackPos-(5-3)]) ? $this->semStack[$stackPos-(5-3)] : array($this->semStack[$stackPos-(5-3)]), 'elseifs' => $this->semStack[$stackPos-(5-4)], 'else' => $this->semStack[$stackPos-(5-5)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes);
|
||||
|
@@ -1250,7 +1250,14 @@ class Php7 extends \PhpParser\ParserAbstract
|
||||
throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
||||
},
|
||||
140 => function ($stackPos) {
|
||||
$this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments']) && isset($stmts[0])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); };
|
||||
|
||||
if ($this->semStack[$stackPos-(3-2)]) {
|
||||
$this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); };
|
||||
} else {
|
||||
$startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; };
|
||||
if (null === $this->semValue) { $this->semValue = array(); }
|
||||
}
|
||||
|
||||
},
|
||||
141 => function ($stackPos) {
|
||||
$this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes);
|
||||
|
Reference in New Issue
Block a user