Skip to content

Commit 100f954

Browse files
author
dsharp
committed
ELSE expressions terminate early when encountering an END token
1 parent 4c45eac commit 100f954

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Components/Expression.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ public static function parse(Parser $parser, TokensList $list, array $options =
275275

276276
$isExpr = true;
277277
} elseif (
278-
$brackets === 0 && strlen((string) $ret->expr) > 0 && ! $alias
279-
&& ($ret->table === null || $ret->table === '')
278+
$token->value === "END" || (
279+
$brackets === 0 && strlen((string) $ret->expr) > 0 && ! $alias
280+
&& ($ret->table === null || $ret->table === '')
281+
)
280282
) {
281283
/* End of expression */
282284
break;

0 commit comments

Comments
 (0)