[parser] Switch on token in ScanSingleToken
Always generate a token for the first character in ScanSingleToken, and switch on that. If the token could change with subsequent characters, e.g. Token::ADD into Token::ASSIGN_ADD, then handle that in that token's case rather than going character-by-character. This allows us to have a tighter packing of the cases, and early detect numbers, keywords and identifiers. Change-Id: I8c3ac7a5453547abeb09fc90826a26390b15a415 Reviewed-on: https://chromium-review.googlesource.com/c/1335547Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#57497}
Showing
This diff is collapsed.
Please
register
or
sign in
to comment