@@ -266,7 +266,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
266266
267267 $ alias = true ;
268268 continue ;
269- } elseif ($ token ->keyword === 'CASE ' ) {
269+ }
270+
271+ if ($ token ->keyword === 'CASE ' ) {
270272 // For a use of CASE like
271273 // 'SELECT a = CASE .... END, b=1, `id`, ... FROM ...'
272274 $ tempCaseExpr = CaseExpression::parse ($ parser , $ list );
@@ -322,21 +324,21 @@ public static function parse(Parser $parser, TokensList $list, array $options =
322324 if ($ brackets === 0 ) {
323325 // Not our bracket
324326 break ;
325- } else {
326- --$ brackets ;
327- if ($ brackets === 0 ) {
328- if (! empty ($ options ['parenthesesDelimited ' ])) {
329- // The current token is the last bracket, the next
330- // one will be outside the expression.
331- $ ret ->expr .= $ token ->token ;
332- ++$ list ->idx ;
333- break ;
334- }
335- } elseif ($ brackets < 0 ) {
336- // $parser->error('Unexpected closing bracket.', $token);
337- // $brackets = 0;
327+ }
328+
329+ --$ brackets ;
330+ if ($ brackets === 0 ) {
331+ if (! empty ($ options ['parenthesesDelimited ' ])) {
332+ // The current token is the last bracket, the next
333+ // one will be outside the expression.
334+ $ ret ->expr .= $ token ->token ;
335+ ++$ list ->idx ;
338336 break ;
339337 }
338+ } elseif ($ brackets < 0 ) {
339+ // $parser->error('Unexpected closing bracket.', $token);
340+ // $brackets = 0;
341+ break ;
340342 }
341343 } elseif ($ token ->value === ', ' ) {
342344 // Expressions are comma-delimited.
0 commit comments