From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:56:10 +0000 (+0200) Subject: [3.12] gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237) ... X-Git-Tag: v3.12.4~169 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db474606f752a3990117c38875554a793a203a2c;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237) (GH-118309) gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237) (cherry picked from commit ef940dec409f0a9e4f353c6188990aeb3ad4ffb4) Co-authored-by: Petr Viktorin --- diff --git a/Doc/tools/extensions/peg_highlight.py b/Doc/tools/extensions/peg_highlight.py index 4bdc2ee18613..5ab5530d2699 100644 --- a/Doc/tools/extensions/peg_highlight.py +++ b/Doc/tools/extensions/peg_highlight.py @@ -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"),