diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2020-05-06 05:33:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 05:33:55 (GMT) |
commit | eff870b618ca6f6b7a60a271f15af7e54b8a1b97 (patch) | |
tree | 7f7798c3f7ef5c476705bf2fdb349adddf14c354 /Doc/tools | |
parent | d60040ba226bd2e3b6f58d074015aa2499dc1cb8 (diff) | |
download | cpython-eff870b618ca6f6b7a60a271f15af7e54b8a1b97.zip cpython-eff870b618ca6f6b7a60a271f15af7e54b8a1b97.tar.gz cpython-eff870b618ca6f6b7a60a271f15af7e54b8a1b97.tar.bz2 |
Revert "bpo-40517: Implement syntax highlighting support for ASDL (#19928)" (#19950)
This reverts commit d60040ba226bd2e3b6f58d074015aa2499dc1cb8.
Diffstat (limited to 'Doc/tools')
-rw-r--r-- | Doc/tools/extensions/asdl_highlight.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/Doc/tools/extensions/asdl_highlight.py b/Doc/tools/extensions/asdl_highlight.py deleted file mode 100644 index 9b003e9..0000000 --- a/Doc/tools/extensions/asdl_highlight.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import sys -sys.path.append(os.path.abspath("../Parser/")) - -from pygments.lexer import RegexLexer, bygroups, include, words -from pygments.token import (Comment, Generic, Keyword, Name, Operator, - Punctuation, Text) - -from asdl import builtin_types -from sphinx.highlighting import lexers - -class ASDLLexer(RegexLexer): - name = "ASDL" - aliases = ["asdl"] - filenames = ["*.asdl"] - _name = r"([^\W\d]\w*)" - _text_ws = r"(\s*)" - - tokens = { - "ws": [ - (r"\n", Text), - (r"\s+", Text), - (r"--.*?$", Comment.Singleline), - ], - "root": [ - include("ws"), - ( - r"(module)" + _text_ws + _name, - bygroups(Keyword, Text, Name.Class), - ), - ( - r"(\w+)(\*\s|\?\s|\s)(\w+)", - bygroups(Name.Variable, Generic.Strong, Name.Tag), - ), - (words(builtin_types), Keyword.Type), - (r"attributes", Name.Builtin), - ( - _name + _text_ws + "(=)", - bygroups(Name.Variable, Text, Operator), - ), - (_name, Name.Function), - (r"\|", Operator), - (r"{|}|\(|\)", Punctuation), - (r".", Text), - ], - } - - -def setup(app): - lexers["asdl"] = ASDLLexer() - return {'version': '1.0', 'parallel_read_safe': True} |