diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-05-26 17:59:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-26 17:59:04 -0700 |
commit | 2dbc2b862fd4502fd36f23499f4504c6cc3b8b73 (patch) | |
tree | 643c9abc9c587233967ac34093a4098d8b1559a6 /src/passes/SimplifyGlobals.cpp | |
parent | 7476d64271354d42d864e1ed21f87f514949bc64 (diff) | |
download | binaryen-2dbc2b862fd4502fd36f23499f4504c6cc3b8b73.tar.gz binaryen-2dbc2b862fd4502fd36f23499f4504c6cc3b8b73.tar.bz2 binaryen-2dbc2b862fd4502fd36f23499f4504c6cc3b8b73.zip |
[Parser] Lex floating point values (#4693)
Rather than trying to actually implement the parsing of float values, which
cannot be done naively due to precision concerns, just parse the float grammar
then postprocess the parsed text into a form we can pass to `strtod` to do the
actual parsing of the value.
Since the float grammar reuses `num` and `hexnum` from the integer grammar but
does not care about overflow, add a mode to `LexIntCtx`, `num`, and `hexnum` to
allow parsing overflowing numbers.
For NaNs, store the payload as a separate value rather than as part of the
parsed double. The payload will be injected into the NaN at a higher level of
the parser once we know whether we are parsing an f64 or an f32 and therefore
know what the allowable payload values are.
Diffstat (limited to 'src/passes/SimplifyGlobals.cpp')
0 files changed, 0 insertions, 0 deletions