JSON5 in dbStatic: Modify lexer's number support

dbLex.l acceps a leading or trailing decimal point with float/double
values and an explicit leading + on all numbers.
Tested in dbStaticTest.db but only passing tests.
This commit is contained in:
Andrew Johnson
2020-07-21 23:33:37 -05:00
parent 980711589a
commit fa4af8b27d
2 changed files with 48 additions and 3 deletions

View File

@@ -25,10 +25,15 @@ hexdigit [0-9a-fA-F]
unicodechar ({backslash}"u"{hexdigit}{4})
jsonchar ({normalchar}|{escapedchar}|{unicodechar})
jsondqstr ({doublequote}{jsonchar}*{doublequote})
int ("-"?([0-9]|[1-9][0-9]+))
sign ([+-]?)
int ({sign}([0-9]|[1-9][0-9]+))
frac ("."[0-9]+)
exp ([eE][+-]?[0-9]+)
number ({int}{frac}?{exp}?)
exp ([eE]{sign}[0-9]+)
jsonnum ({int}{frac}?{exp}?)
intexp ({int}"."{exp}?)
fracexp ({sign}{frac}{exp}?)
number ({jsonnum}|{intexp}|{fracexp})
%{
#undef YY_INPUT