Commit ed77644b authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[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: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57497}
parent 01f7ff54
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment