Skip to content

Commit

Permalink
fix(lexer): simplified a few things in the lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
KFlash committed Aug 2, 2019
1 parent 79e8fa3 commit 8415be7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lexer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export function scanSingleToken(parser: ParserState, context: Context, state: Le
// Check that it's not followed by any numbers
if (index < parser.end) {
ch = parser.source.charCodeAt(index);
if ((CharTypes[ch] & CharFlags.Decimal) === 0) {
if ((CharTypes[ch] & CharFlags.Decimal) < 1) {
advanceChar(parser);
return Token.OptionalChaining;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ export function scanSingleToken(parser: ParserState, context: Context, state: Le
}
return Token.LessThan;
} else if (ch === Chars.Slash) {
if (!(context & Context.OptionsJSX)) return Token.LessThan;
if ((context & Context.OptionsJSX) < 1) return Token.LessThan;
const index = parser.index + 1;

// Check that it's not a comment start.
Expand All @@ -274,6 +274,7 @@ export function scanSingleToken(parser: ParserState, context: Context, state: Le
}
}
return Token.LessThan;

// `=`, `==`, `===`, `=>`
case Token.Assign: {
advanceChar(parser);
Expand Down

0 comments on commit 8415be7

Please sign in to comment.