harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 70cd7548e3cea3bf2b326c1328879912de348d99
parent 34aa3082c18d6e249f2d23404821ee77c6960969
Author: Vlad-Stefan Harbuz <vlad@vladh.net>
Date:   Mon,  5 Jul 2021 18:49:00 +0200

Add support for parsing subnormal floats

smlckz let me know my test was faulty, this one should be good.

Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>

Diffstat:
Msrc/lex.c | 2+-
Mtests/00-constants.ha | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lex.c b/src/lex.c @@ -458,7 +458,7 @@ finalize: default: assert(0); } - if (errno == ERANGE) { + if (errno == ERANGE && !isfloat) { out->token = T_ERROR; } consume(lexer, -1); diff --git a/tests/00-constants.ha b/tests/00-constants.ha @@ -9,5 +9,5 @@ export fn main() void = { r11 = '\v', r12 = '\\', r13 = '\'', r14 = '\"', r15 = '\U12345678'; let f1 = 1.0, f2 = 1f32, f3 = 1.0e2, f4 = 1.0f64; - let f5 = 1.23e+45, f6 = 9.87e-65, f7 = 1e-7; + let f5 = 1.23e+45, f6 = 9.87e-65, f7 = 1e-7, f8 = 5.0e-324; };