tom icon indicating copy to clipboard operation
tom copied to clipboard

Support nan/inf floating point literals

Open matklad opened this issue 7 years ago • 1 comments
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.

matklad avatar Jul 14 '18 15:07 matklad

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.

ehuss avatar Jul 30 '18 05:07 ehuss