Closed waynepiekarski closed 2 years ago
I also have another case where the parser won't accept floats with a leading + symbol, requiring a newline after as well:
hjson.parse(`{ A: +123.45, B: -987.65 }`, { dsf: dsf });
Error: End of input while parsing an object (missing '}') at line 1,26 >>> A: +123.45, B: -987 ...
nan
is not recognized as a number by Hjson. It is therefore treated as an unquoted string, and then everything after nan
on the same line is seen as part of the unquoted string.
A leading +
is also not recognized as a number, also gets treated as an unquoted string.
See syntax definition of number:
When trying to parse nan values using dsf.math, I get an error with the following simple test case:
Error: End of input while parsing an object (missing '}') at line 1,18 >>> A: nan, B: 1.0 } ...
However, if you put a newline after the nan, then it works fine:
I'm new to hjson, but is there a trick to getting this to work, or is there a bug in the parser?