Skip to content

Commit

Permalink
fix: escape braces in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Mar 10, 2024
1 parent 22a0bb2 commit 9d86f37
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ module.exports = grammar({

chained_string: $ => seq($.string, repeat1($.string)),

character: $ => /\?(\\\S({[0-9A-Fa-f]*}|[0-9A-Fa-f]*|-\S([MC]-\S)?)?|\S)/,
character: $ => /\?(\\\S(\{[0-9A-Fa-f]*\}|[0-9A-Fa-f]*|-\S([MC]-\S)?)?|\S)/,

interpolation: $ => choice(
seq('#{', optional($._statements), '}'),
Expand Down Expand Up @@ -1167,7 +1167,7 @@ module.exports = grammar({
/x[0-9a-fA-F]{1,2}/, // hex code
/[0-7]{1,3}/, // octal
/u[0-9a-fA-F]{4}/, // single unicode
/u{[0-9a-fA-F ]+}/, // multiple unicode
/u\{[0-9a-fA-F]+\}/, // multiple unicode
),
)),

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"author": "Rob Rix",
"license": "MIT",
"dependencies": {
"nan": "^2.18.0",
"nan": "^2.19.0",
"node-gyp": "^10.0.1",
"prebuild-install": "^7.1.1"
"prebuild-install": "^7.1.2"
},
"devDependencies": {
"eslint": ">=8.56.0",
"eslint": ">=8.57.0",
"eslint-config-google": "^0.14.0",
"prebuild": "^13.0.0",
"tree-sitter-cli": "^0.20.8"
"tree-sitter-cli": "^0.21.0"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build",
Expand Down
4 changes: 2 additions & 2 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions src/parser.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9d86f37

Please sign in to comment.