Skip to content

Commit

Permalink
feat: use the new reserved rules api
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Nov 24, 2024
1 parent 6d14e44 commit 258dc6b
Show file tree
Hide file tree
Showing 6 changed files with 57,355 additions and 58,010 deletions.
13 changes: 13 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ module.exports = grammar({
$.keyword_identifier,
],

reserved: {
global: _ => [
// https://docs.python.org/3/reference/lexical_analysis.html#keywords
'False', 'await', 'else', 'import', 'pass',
'None', 'break', 'except', 'in', 'raise',
'True', 'class', 'finally', 'is', 'return',
'and', 'continue', 'for', 'lambda', 'try',
'as', 'def', 'from', 'nonlocal', 'while',
'assert', 'del', 'global', 'not', 'with',
'async', 'elif', 'if', 'or', 'yield',
],
},

word: $ => $.identifier,

rules: {
Expand Down
146 changes: 145 additions & 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 258dc6b

Please # to comment.