forked from Imagelibrary/littlefs
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:
@@ -1129,7 +1129,7 @@ class CsvExpr:
|
|||||||
p.chomp()
|
p.chomp()
|
||||||
|
|
||||||
# floats
|
# floats
|
||||||
elif p.match('[+-]?(?:[_0-9]*\.[_0-9eE]|nan)'):
|
elif p.match('[+-]?(?:[_0-9]*\.[_0-9eE]*|nan)'):
|
||||||
a = CsvExpr.FloatLit(CsvFloat(p.chomp()))
|
a = CsvExpr.FloatLit(CsvFloat(p.chomp()))
|
||||||
|
|
||||||
# ints
|
# ints
|
||||||
|
|||||||
Reference in New Issue
Block a user