My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 1: Correctly parsing JSON floats [rough fix included].
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by barry.al...@gmail.com, Oct 13, 2012
Token pattern in question:

(\+|\-)?(0|{D1}{D}*)\.{D}+((e|E)(\+|\-)?{D1}{D}*)?

Floats with exponents missing fraction, e.g., "1.e9" are valid in the spec. [1]

Of course, those are not directly valid as erlang floats.

Might want to consider an additional production of the form:

(\+|\-)?(0|{D1}{D}*)\.((e|E)(\+|\-)?{D1}{D}*)? :
    {token, {number, TokenLine, element(1, string:to_float(string:join(string:tokens(TokenChars, "."), ".0")))}}.

Regards,
Barry Allard

References:
[1] http://www.json.org

Powered by Google Project Hosting