@@ -425,33 +425,32 @@ public static function parse(Parser $parser, TokensList $list, array $options =
425425 break ;
426426 }
427427 } elseif (! self ::checkIfTokenQuotedSymbol ($ token )) {
428- if (! empty (Parser::$ statementParsers [$ token ->value ])) {
428+ // If the current token is "SET" or "ENUM", we want to avoid the token between their parenthesis in
429+ // the unknown tokens.
430+ if (in_array ($ token ->value , ['SET ' , 'ENUM ' ], true )) {
429431 $ list ->idx ++; // Ignore the current token
430432 $ nextToken = $ list ->getNext ();
431433
432- if (
433- in_array ($ token ->value , ['SET ' , 'ENUM ' ], true )
434- && $ nextToken !== null
435- && $ nextToken ->value === '( '
436- ) {
437- // To avoid adding the tokens between the SET() or ENUM() parentheses to the unknown tokens
434+ if ($ nextToken !== null && $ nextToken ->value === '( ' ) {
438435 $ list ->getNextOfTypeAndValue (Token::TYPE_OPERATOR , ') ' );
439- } elseif (
440- in_array ($ token ->value , ['SET ' , 'ENUM ' ], true )
441- && $ nextToken !== null
442- && $ nextToken ->value === 'DEFAULT '
443- ) {
436+ } elseif ($ nextToken !== null && $ nextToken ->value === 'DEFAULT ' ) {
444437 // to avoid adding the `DEFAULT` token to the unknown tokens.
445438 ++$ list ->idx ;
446439 } else {
447- // We have reached the end of ALTER operation and suddenly found
448- // a start to new statement, but have not find a delimiter between them
449440 $ parser ->error (
450441 'A new statement was found, but no delimiter between it and the previous one. ' ,
451442 $ token
452443 );
453444 break ;
454445 }
446+ } elseif (! empty (Parser::$ statementParsers [$ token ->value ])) {
447+ // We have reached the end of ALTER operation and suddenly found
448+ // a start to new statement, but have not found a delimiter between them
449+ $ parser ->error (
450+ 'A new statement was found, but no delimiter between it and the previous one. ' ,
451+ $ token
452+ );
453+ break ;
455454 } elseif (
456455 (array_key_exists ($ arrayKey , self ::$ databaseOptions )
457456 || array_key_exists ($ arrayKey , self ::$ tableOptions ))
0 commit comments