3 ms·
I went down a similar route in a performance-sensitive lexer (started with naive code, spent some time fiddling with different ways to express it) and eventuall
by evmar 11y ago
I went down a similar route in a performance-sensitive lexer (started with naive code, spent some time fiddling with different ways to express it) and eventually used a lexer generator, which uses a combination of lookup tables and tests.
https://github.com/martine/ninja/blob/master/src/lexer.cc#L117 https://github.com/martine/ninja/blob/master/src/lexer.cc#L1...