]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)
authorPetr Viktorin <encukou@gmail.com>
Fri, 26 Apr 2024 09:01:30 +0000 (11:01 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 09:01:30 +0000 (11:01 +0200)
Doc/tools/extensions/peg_highlight.py

index 4bdc2ee1861334b5ae03715e855d373c2f8e9170..5ab5530d2699012dd733e2e09d2626d98aaec04e 100644 (file)
@@ -16,6 +16,7 @@ class PEGLexer(RegexLexer):
         - Rule types
         - Rule options
         - Rules named `invalid_*` or `incorrect_*`
+        - Rules with `RAISE_SYNTAX_ERROR`
     """
 
     name = "PEG"
@@ -59,6 +60,7 @@ class PEGLexer(RegexLexer):
             (r"^(\s+\|\s+.*invalid_\w+.*\n)", bygroups(None)),
             (r"^(\s+\|\s+.*incorrect_\w+.*\n)", bygroups(None)),
             (r"^(#.*invalid syntax.*(?:.|\n)*)", bygroups(None),),
+            (r"^(\s+\|\s+.*\{[^}]*RAISE_SYNTAX_ERROR[^}]*\})\n", bygroups(None)),
         ],
         "root": [
             include("invalids"),