tom
tom copied to clipboard
Support nan/inf floating point literals
trafficstars
This is essentially #2 , but for "Add special float values (inf, nan)". See #2 for mentoring instructions.
E-unknown, because inf could be both a floating-point literal and a bare key, so some tricks might be required for disambiguation. See BARE_KEY_OR_NUMBER.
Is there a reason the text of a token is not used in the parser? It would be easy to say if BARE_KEY && text == "inf" to emit a FLOAT symbol, but the text doesn't seem readily available. Otherwise, the only other idea I had was to add an INFNAN token, and then remap as needed.