Skip to content

Commit

Permalink
feat: allow $ in identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Oct 16, 2023
1 parent f1075f2 commit eedfe12
Show file tree
Hide file tree
Showing 5 changed files with 1,981 additions and 2,552 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,8 @@ module.exports = grammar({
null: _ => choice('NULL', 'nullptr'),

identifier: _ =>
/(\p{XID_Start}|_|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8})(\p{XID_Continue}|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8})*/,
// eslint-disable-next-line max-len
/(\p{XID_Start}|\$|_|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8})(\p{XID_Continue}|\$|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8})*/,

_type_identifier: $ => alias(
$.identifier,
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "bindings/node",
"keywords": [
"parser",
"lexer"
"lexer",
"c"
],
"repository": {
"type": "git",
Expand All @@ -14,10 +15,10 @@
"author": "Max Brunsfeld",
"license": "MIT",
"dependencies": {
"nan": "^2.17.0"
"nan": "^2.18.0"
},
"devDependencies": {
"eslint": "^8.46.0",
"eslint": "^8.51.0",
"eslint-config-google": "^0.14.0",
"tree-sitter-cli": "^0.20.8"
},
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json

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

Loading

0 comments on commit eedfe12

Please sign in to comment.