Skip to content

Commit 8d98f21

Browse files
CHG: functions without parameter list doesn't have a sub_tree (set property sub_tree to false instead of an empty array)
git-svn-id: https://php-sql-parser.googlecode.com/svn/trunk@1349 44dcfd11-89b7-3d55-2063-5c365055f77f
1 parent f7e24e7 commit 8d98f21

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/PHPSQLParser/processors/ExpressionListProcessor.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ public function process($tokens) {
168168
}
169169

170170
if (!$curr->getSubTree()) {
171-
$curr->setSubTree($localExprList);
171+
if (!empty($localExprList)) {
172+
$curr->setSubTree($localExprList);
173+
}
172174
} else {
173175
$tmpExprList = $curr->getSubTree();
174176
$curr->setSubTree(array_merge($tmpExprList, $localExprList));
@@ -191,7 +193,9 @@ public function process($tokens) {
191193
}
192194

193195
if (!$curr->getSubTree()) {
194-
$curr->setSubTree($localExprList);
196+
if (!empty($localExprList)) {
197+
$curr->setSubTree($localExprList);
198+
}
195199
} else {
196200
$tmpExprList = $curr->getSubTree();
197201
$curr->setSubTree(array_merge($tmpExprList, $localExprList));
@@ -237,7 +241,9 @@ public function process($tokens) {
237241
}
238242

239243
if (!$curr->getSubTree()) {
240-
$curr->setSubTree($localExprList);
244+
if (!empty($localExprList)) {
245+
$curr->setSubTree($localExprList);
246+
}
241247
} else {
242248
$tmpExprList = $curr->getSubTree();
243249
$curr->setSubTree(array_merge($tmpExprList, $localExprList));
@@ -253,7 +259,9 @@ public function process($tokens) {
253259

254260
$curr->setTokenType(ExpressionType::BRACKET_EXPRESSION);
255261
if (!$curr->getSubTree()) {
256-
$curr->setSubTree($localExprList);
262+
if (!empty($localExprList)) {
263+
$curr->setSubTree($localExprList);
264+
}
257265
} else {
258266
$tmpExprList = $curr->getSubTree();
259267
$curr->setSubTree(array_merge($tmpExprList, $localExprList));

0 commit comments

Comments
 (0)