4 ms·
That's fairly common in languages that aren't particularly whitespace sensitive.
by ksherlock 13y ago
That's fairly common in languages that aren't particularly whitespace sensitive.
- vstm 13y agoAgreed. The lexer just recognizes tokens it does (usually/ideally) not know about the grammar, the parser checks if the "token stream" actually complies with the grammar. If the grammar allows for example "2x" as a "shortcut" for "2 * x" (if you parse mathematical expressions) it would make sense. Nitpick: Depending on the syntax the lexer might also yield 99f (float literal) and the identifier "oo".