eudoxia0 / cl-yaml

YAML parser for Common Lisp
61 stars 7 forks source link

Floating-Point-Overflow when parsing "base03: 7e7887" #12

Open tpine opened 7 years ago

tpine commented 7 years ago

When executing (cl-yaml:parse "base03: 7e7887") a floating-point-overflow error occurs. 7e7887 is meant to be a hex color and not converted to a number. The string causing the error is read from a file where it is in quotes but this triggers the test case. Surrounding the hex code in \"\" still triggers the error and it appears that it ignores reading the quotes.

This may be a duplicate of #7 except it triggers a separate error. The attached file is the one which is being read. atelier-cave-light.txt

tpine commented 7 years ago

So it appears that the issue is that the ppcre:scanner for +float-scanner+ picks up the string as a float and then attempts to parse it as a float (due to the rest of the string being numbers so the regex picks up the e as a exponential).

Would it make sense in these cases for the parser to catch all errors which occur in parsing the strings to numbers and if one occurs to treat the input as a string? That would also fix issue #7.