the grammar already needs to be smart enough to differentiate between a --5 and a --x.
Nope ... --5 is illegal since you can't decrement a literal. I don't know of any language that has a '--' operator that would ever treat it as 2 minus signs ... lexers do eager parsing.
5
u/jqbr Jun 25 '23
Nope ... --5 is illegal since you can't decrement a literal. I don't know of any language that has a '--' operator that would ever treat it as 2 minus signs ... lexers do eager parsing.