Skip to content

Commit

Permalink
Use new grammar API for reserved words
Browse files Browse the repository at this point in the history
Co-authored-by: Amaan <[email protected]>
  • Loading branch information
maxbrunsfeld and amaanq committed Nov 22, 2024
1 parent 88b4235 commit 409ee41
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 219 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = grammar({
],

reserved: {
global: [
global: $ => [
'const',
'do',
'else',
Expand All @@ -45,7 +45,7 @@ module.exports = grammar({
'var',
'while',
],
properties: [],
properties: $ => [],
},

supertypes: $ => [
Expand Down Expand Up @@ -1217,7 +1217,7 @@ module.exports = grammar({
field('value', choice($.pattern, $.assignment_pattern)),
),

_property_name: $ => reserved([], choice(
_property_name: $ => reserved('properties', choice(
alias(choice(
$.identifier,
$._reserved_identifier

Check failure on line 1223 in grammar.js

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
Expand Down
107 changes: 55 additions & 52 deletions 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 409ee41

Please sign in to comment.