]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 4 Jan 2022 11:03:46 +0000 (03:03 -0800)
committerGitHub <noreply@github.com>
Tue, 4 Jan 2022 11:03:46 +0000 (03:03 -0800)
(cherry picked from commit e09d94a140a5f6903017da9b6ac752ba041d69da)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Doc/tools/extensions/peg_highlight.py

index 42101be10ea9b6c80580b6eeac1aa497f7349432..27f54cdf593c875d903e75eef3f44be48102a641 100644 (file)
@@ -56,8 +56,8 @@ class PEGLexer(RegexLexer):
             (_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)),
+            (r"^(\s+\|\s+.*invalid_\w+.*\n)", bygroups(None)),
+            (r"^(\s+\|\s+.*incorrect_\w+.*\n)", bygroups(None)),
             (r"^(#.*invalid syntax.*(?:.|\n)*)", bygroups(None),),
         ],
         "root": [