scripts: csv.py: Fixed completely broken float parsing

Whoops! A missing splat repetition here meant we only ever accepted
floats with a single digit of precision and no e/E exponents.

Humorously this went unnoticed because our scripts were only
_outputting_ single digit floats, but now that that's fixed, float
parsing also needs a fix.

Fixed by allowing >1 digit of precision in our CsvFloat regex.
This commit is contained in:
Christopher Haster
2025-05-15 15:32:38 -05:00
parent d5b28df33a
commit d4c772907d

View File

@@ -1129,7 +1129,7 @@ class CsvExpr:
p.chomp()
# floats
elif p.match('[+-]?(?:[_0-9]*\.[_0-9eE]|nan)'):
elif p.match('[+-]?(?:[_0-9]*\.[_0-9eE]*|nan)'):
a = CsvExpr.FloatLit(CsvFloat(p.chomp()))
# ints