Improve JS and JSON parsing

pull/25/head
Wilfred Hughes 2021-07-20 01:18:39 +07:00
parent 7bd8afc439
commit c48e8e2977
2 changed files with 8 additions and 0 deletions

@ -20,6 +20,8 @@ Improved parsing for Scheme symbols containing `=`, and punctuation of
Improved parsing of `=` and `&` in Clojure.
Improved parsing of `:`, `,`, and constants in JSON.
Improved parsing of string literals in all languages, supporting
escaped delimiters such as `"\""` and removing incorrect support for
single-quoted strings in JSON.

@ -15,6 +15,8 @@ string_patterns = [
'"((\\")|[^"])*"',
# Single quoted strings
"'((\\\\')|[^'])*'",
# Backtick strings
'`((\\`)|[^`])*1`',
]
comment_patterns = [
# Single line comments
@ -30,6 +32,10 @@ extensions = ["json"]
atom_patterns = [
# Numbers
'[0-9]+',
# Booleans
'(true)|(false)|(null)',
# Punctuation
"[:,]",
]
string_patterns = [
# Double-quoted strings