Closed NaridaL closed 2 years ago
Json.org has a bnf describing valid chars. Just use that?
@mattbishop is correct, we should re-evaluate the regexp from scratch, It is possible I copy pasted it in the past and that it is not fully aligned with the JSON spec.
It may not be a direct 1 to 1 translation as the BNF may not translate to JavaScript regexp directly and JS string quirks.
See https://github.com/Chevrotain/chevrotain/blob/master/packages/chevrotain/benchmark_web/parsers/json/json_parser.js
":?" is an optional :, not a non-capturing group. Additionally, nested + and * lead to terrible performance when not matching.
Fixes #1788