Skip to content

Commit

Permalink
Update JavaScript and TypeScript keywords
Browse files Browse the repository at this point in the history
Moved some of reserved keywords to keywords and to declarations keywords.
  • Loading branch information
Mesteery committed Dec 30, 2020
1 parent dca9e5b commit b141da0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions pygments/lexers/javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class JavascriptLexer(RegexLexer):
(r'[})\].]', Punctuation),
(r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
r'throw|try|catch|finally|new|delete|typeof|instanceof|void|yield|await|async|'
r'this|of)\b', Keyword, 'slashstartsregex'),
(r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
(r'(abstract|boolean|byte|char|class|const|debugger|double|enum|export|'
r'extends|final|float|goto|implements|import|int|interface|long|native|'
r'package|private|protected|public|short|static|super|synchronized|throws|'
r'this|of|import|export|static|super|extends|debugger)\b', Keyword, 'slashstartsregex'),
(r'(var|let|const|with|function|class)\b', Keyword.Declaration, 'slashstartsregex'),
(r'(abstract|boolean|byte|char|double|enum|'
r'|final|float|goto|implements|int|interface|long|native|'
r'package|private|protected|public|short|synchronized|throws|'
r'transient|volatile)\b', Keyword.Reserved),
(r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
(r'(Array|Boolean|Date|Error|Function|Math|'
Expand Down Expand Up @@ -490,12 +490,11 @@ class TypeScriptLexer(RegexLexer):
(r'[})\].]', Punctuation),
(r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
r'throw|try|catch|finally|new|delete|typeof|instanceof|void|of|'
r'this|async|await|yield)\b', Keyword, 'slashstartsregex'),
(r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
(r'(abstract|boolean|byte|char|class|const|debugger|double|enum|export|'
r'extends|final|float|goto|implements|import|int|interface|long|native|'
r'package|private|protected|public|short|static|super|synchronized|throws|'
r'transient|volatile)\b', Keyword.Reserved),
r'this|async|await|yield|extends|implements|private|protected|public|'
r'abstract|static|super|import|export')\b', Keyword, 'slashstartsregex'),
(r'(var|let|const|with|function|class|interface|type|enum)\b', Keyword.Declaration, 'slashstartsregex'),
(r'(boolean|byte|char|double|final|float|goto|int|long|'
r'native|package|short|synchronized|throws|transient|volatile)\b', Keyword.Reserved),
(r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
(r'(Array|Boolean|Date|Error|Function|Math|'
r'Number|Object|RegExp|String|decodeURI|'
Expand Down

0 comments on commit b141da0

Please sign in to comment.