JSON5 in dbStatic: Lexer support for NaN and Infinity
The JSON5 spec requires exact capitalization of these strings. Other numeric parsers such as strtod() are usually more lenient.
This commit is contained in:
@@ -33,10 +33,11 @@ exp ([eE]{sign}[0-9]+)
|
||||
jsonnum ({int}{frac}?{exp}?)
|
||||
intexp ({int}"."{exp}?)
|
||||
fracexp ({sign}{frac}{exp}?)
|
||||
specialnum ("NaN"|{sign}"Infinity")
|
||||
|
||||
zerox ("0x"|"0X")
|
||||
hexint ({sign}{zerox}{hexdigit}+)
|
||||
number ({jsonnum}|{intexp}|{fracexp}|{hexint})
|
||||
number ({jsonnum}|{intexp}|{fracexp}|{specialnum}|{hexint})
|
||||
|
||||
%{
|
||||
#undef YY_INPUT
|
||||
|
||||
Reference in New Issue
Block a user