Skip to content

Commit 409ee41

Browse files
maxbrunsfeldamaanq
andcommitted
Use new grammar API for reserved words
Co-authored-by: Amaan <[email protected]>
1 parent 88b4235 commit 409ee41

File tree

4 files changed

+212
-219
lines changed

4 files changed

+212
-219
lines changed

grammar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = grammar({
3131
],
3232

3333
reserved: {
34-
global: [
34+
global: $ => [
3535
'const',
3636
'do',
3737
'else',
@@ -45,7 +45,7 @@ module.exports = grammar({
4545
'var',
4646
'while',
4747
],
48-
properties: [],
48+
properties: $ => [],
4949
},
5050

5151
supertypes: $ => [
@@ -1217,7 +1217,7 @@ module.exports = grammar({
12171217
field('value', choice($.pattern, $.assignment_pattern)),
12181218
),
12191219

1220-
_property_name: $ => reserved([], choice(
1220+
_property_name: $ => reserved('properties', choice(
12211221
alias(choice(
12221222
$.identifier,
12231223
$._reserved_identifier

src/grammar.json

+55-52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)