From c48e8e29777e4ceec32a707b95499fe4c9fc6954 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 20 Jul 2021 01:18:39 -0700 Subject: [PATCH] Improve JS and JSON parsing --- CHANGELOG.md | 2 ++ config/syntax.toml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a30a59d..a8649f8ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/config/syntax.toml b/config/syntax.toml index 1b70bcaaa..dcd77273f 100644 --- a/config/syntax.toml +++ b/config/syntax.toml @@ -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