File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed
Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -462,23 +462,12 @@ export class Tokenizer {
462462 if ( specialIdent !== undefined ) {
463463 /* Merge multi-token operators, like 'is not', 'not in' */
464464 const previousToken = this . tokens [ this . tokens . length - 1 ] ;
465- switch ( specialIdent ) {
466- case TokenType . NOT :
467- if ( previousToken . type === TokenType . IS ) {
468- this . overwriteToken ( TokenType . ISNOT ) ;
469- } else {
470- this . addToken ( specialIdent ) ;
471- }
472- return ;
473- case TokenType . IN :
474- if ( previousToken . type === TokenType . NOT ) {
475- this . overwriteToken ( TokenType . NOTIN ) ;
476- } else {
477- this . addToken ( specialIdent ) ;
478- }
479- return ;
480- default :
481- this . addToken ( specialIdent ) ;
465+ if ( specialIdent === TokenType . NOT && previousToken ?. type === TokenType . IS ) {
466+ this . overwriteToken ( TokenType . ISNOT ) ;
467+ } else if ( specialIdent === TokenType . IN && previousToken ?. type === TokenType . NOT ) {
468+ this . overwriteToken ( TokenType . NOTIN ) ;
469+ } else {
470+ this . addToken ( specialIdent ) ;
482471 }
483472 } else {
484473 this . addToken ( TokenType . NAME ) ;
You can’t perform that action at this time.
0 commit comments