mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix type group capture in the PEG highlight tool (GH-25464)
This commit is contained in:
parent
0b1c169c4a
commit
f5c5c0c362
1 changed files with 7 additions and 2 deletions
|
@ -42,14 +42,19 @@ class PEGLexer(RegexLexer):
|
|||
(r"(@\w+ '''(.|\n)+?''')", bygroups(None)),
|
||||
(r"^(@.*)$", bygroups(None)),
|
||||
],
|
||||
"actions": [(r"{(.|\n)+?}", bygroups(None)),],
|
||||
"actions": [
|
||||
(r"{(.|\n)+?}", bygroups(None)),
|
||||
],
|
||||
"strings": [
|
||||
(r"'\w+?'", Keyword),
|
||||
(r'"\w+?"', Keyword),
|
||||
(r"'\W+?'", Text),
|
||||
(r'"\W+?"', Text),
|
||||
],
|
||||
"variables": [(_name + _text_ws + r"(\[.*\])?" + _text_ws + "(=)", bygroups(None, None, None, None, None),),],
|
||||
"variables": [
|
||||
(_name + _text_ws + "(=)", bygroups(None, None, None),),
|
||||
(_name + _text_ws + r"(\[[\w\d_\*]+?\])" + _text_ws + "(=)", bygroups(None, None, None, None, None),),
|
||||
],
|
||||
"invalids": [
|
||||
(r"^(\s+\|\s+invalid_\w+\s*\n)", bygroups(None)),
|
||||
(r"^(\s+\|\s+incorrect_\w+\s*\n)", bygroups(None)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue