bdwalker93 / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Number problems in json.lex. #21

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I was looking at 
http://code.google.com/p/json-simple/source/browse/trunk/doc/json.lex

It seems to have a few problems.
  -0 is parsed using Long.valueOf which loses the sign bit.
  0123 is treated as a valid number despite the JSON grammar specifically disallowing leading 
zeroes.

http://code.google.com/p/prebake/source/browse/trunk/src/org/prebake/js/json_gra
mmar.lex 
addresses that problem and makes sure that
    nulltrue
does not lex as the tokens
    ["null", "true"]

Original issue reported on code.google.com by mikesamuel@gmail.com on 16 Apr 2010 at 8:24

GoogleCodeExporter commented 8 years ago

Original comment by fangyid...@gmail.com on 14 Jul 2010 at 1:09

GoogleCodeExporter commented 8 years ago
Thanks mikesamuel.
Updated the link to the improved lex file:
http://code.google.com/p/prebake/source/browse/trunk/code/src/org/prebake/js/jso
n_grammar.lex

Original comment by fangyid...@gmail.com on 14 Jul 2010 at 1:21