@@ -426,33 +426,26 @@ public static function parse(Parser $parser, TokensList $list, array $options =
426426                    } elseif  (($ token ->value  === ', ' ) && ($ brackets  === 0 )) {
427427                        break ;
428428                    }
429-                 } elseif  (! self ::checkIfTokenQuotedSymbol ($ token )) {
430-                     // If the current token is "SET" or "ENUM", we want to avoid the token between their parenthesis in 
431-                     // the unknown tokens. 
432-                     if  (in_array ($ token ->value , ['SET ' , 'ENUM ' ], true )) {
429+                 } elseif  (! self ::checkIfTokenQuotedSymbol ($ token ) && $ token ->type  !== Token::TYPE_STRING ) {
430+                     if  (isset (Parser::$ STATEMENT_PARSERS  [$ arrayKey ]) && Parser::$ STATEMENT_PARSERS  [$ arrayKey ] !== '' ) {
433431                        $ list ->idx ++; // Ignore the current token 
434432                        $ nextToken  = $ list ->getNext ();
435433
436-                         if  ($ nextToken  !== null  && $ nextToken ->value  === '( ' ) {
434+                         if  ($ token ->value  === 'SET '  && $ nextToken  !== null  && $ nextToken ->value  === '( ' ) {
435+                             // To avoid adding the tokens between the SET() parentheses to the unknown tokens 
437436                            $ list ->getNextOfTypeAndValue (Token::TYPE_OPERATOR , ') ' );
438-                         } elseif  ($ nextToken  !== null  && $ nextToken ->value  === 'DEFAULT ' ) {
437+                         } elseif  ($ token -> value  ===  ' SET '  &&  $ nextToken  !== null  && $ nextToken ->value  === 'DEFAULT ' ) {
439438                            // to avoid adding the `DEFAULT` token to the unknown tokens. 
440439                            ++$ list ->idx ;
441440                        } else  {
441+                             // We have reached the end of ALTER operation and suddenly found 
442+                             // a start to new statement, but have not found a delimiter between them 
442443                            $ parser ->error (
443444                                'A new statement was found, but no delimiter between it and the previous one. ' ,
444445                                $ token
445446                            );
446447                            break ;
447448                        }
448-                     } elseif  (! empty (Parser::$ STATEMENT_PARSERS  [$ arrayKey ])) {
449-                         // We have reached the end of ALTER operation and suddenly found 
450-                         // a start to new statement, but have not found a delimiter between them 
451-                         $ parser ->error (
452-                             'A new statement was found, but no delimiter between it and the previous one. ' ,
453-                             $ token
454-                         );
455-                         break ;
456449                    } elseif  (
457450                        (array_key_exists ($ arrayKey , self ::$ DB_OPTIONS  )
458451                        || array_key_exists ($ arrayKey , self ::$ TABLE_OPTIONS  ))
0 commit comments