summaryrefslogtreecommitdiff
path: root/src/passes/SimplifyGlobals.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-05-26 17:59:04 -0700
committerGitHub <noreply@github.com>2022-05-26 17:59:04 -0700
commit2dbc2b862fd4502fd36f23499f4504c6cc3b8b73 (patch)
tree643c9abc9c587233967ac34093a4098d8b1559a6 /src/passes/SimplifyGlobals.cpp
parent7476d64271354d42d864e1ed21f87f514949bc64 (diff)
downloadbinaryen-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