@@ -400,33 +400,26 @@ public static function parse(Parser $parser, TokensList $list, array $options =
400400 } elseif (($ token ->value === ', ' ) && ($ brackets === 0 )) {
401401 break ;
402402 }
403- } elseif (! self ::checkIfTokenQuotedSymbol ($ token )) {
404- // If the current token is "SET" or "ENUM", we want to avoid the token between their parenthesis in
405- // the unknown tokens.
406- if (in_array ($ token ->value , ['SET ' , 'ENUM ' ], true )) {
403+ } elseif (! self ::checkIfTokenQuotedSymbol ($ token ) && $ token ->type !== Token::TYPE_STRING ) {
404+ if (isset (Parser::STATEMENT_PARSERS [$ arrayKey ]) && Parser::STATEMENT_PARSERS [$ arrayKey ] !== '' ) {
407405 $ list ->idx ++; // Ignore the current token
408406 $ nextToken = $ list ->getNext ();
409407
410- if ($ nextToken !== null && $ nextToken ->value === '( ' ) {
408+ if ($ token ->value === 'SET ' && $ nextToken !== null && $ nextToken ->value === '( ' ) {
409+ // To avoid adding the tokens between the SET() parentheses to the unknown tokens
411410 $ list ->getNextOfTypeAndValue (Token::TYPE_OPERATOR , ') ' );
412- } elseif ($ nextToken !== null && $ nextToken ->value === 'DEFAULT ' ) {
411+ } elseif ($ token -> value === ' SET ' && $ nextToken !== null && $ nextToken ->value === 'DEFAULT ' ) {
413412 // to avoid adding the `DEFAULT` token to the unknown tokens.
414413 ++$ list ->idx ;
415414 } else {
415+ // We have reached the end of ALTER operation and suddenly found
416+ // a start to new statement, but have not found a delimiter between them
416417 $ parser ->error (
417418 'A new statement was found, but no delimiter between it and the previous one. ' ,
418419 $ token
419420 );
420421 break ;
421422 }
422- } elseif (! empty (Parser::STATEMENT_PARSERS [$ arrayKey ])) {
423- // We have reached the end of ALTER operation and suddenly found
424- // a start to new statement, but have not found a delimiter between them
425- $ parser ->error (
426- 'A new statement was found, but no delimiter between it and the previous one. ' ,
427- $ token
428- );
429- break ;
430423 } elseif (
431424 (array_key_exists ($ arrayKey , self ::DATABASE_OPTIONS )
432425 || array_key_exists ($ arrayKey , self ::TABLE_OPTIONS ))
0 commit comments