Skip to content

Commit 56ec40d

Browse files
committed
feat: use the new reserved rules api
1 parent 9d3f4b0 commit 56ec40d

File tree

6 files changed

+57951
-58515
lines changed

6 files changed

+57951
-58515
lines changed

grammar.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ module.exports = grammar({
9999
$.keyword_identifier,
100100
],
101101

102+
reserved: {
103+
global: _ => [
104+
// https://docs.python.org/3/reference/lexical_analysis.html#keywords
105+
'False', 'await', 'else', 'import', 'pass',
106+
'None', 'break', 'except', 'in', 'raise',
107+
'True', 'class', 'finally', 'is', 'return',
108+
'and', 'continue', 'for', 'lambda', 'try',
109+
'as', 'def', 'from', 'nonlocal', 'while',
110+
'assert', 'del', 'global', 'not', 'with',
111+
'async', 'elif', 'if', 'or', 'yield',
112+
],
113+
},
114+
102115
word: $ => $.identifier,
103116

104117
rules: {

src/grammar.json

Lines changed: 146 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)