Skip to content

Commit ef940de

Browse files
authored
gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)
1 parent 09c2947 commit ef940de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/tools/extensions/peg_highlight.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class PEGLexer(RegexLexer):
1616
- Rule types
1717
- Rule options
1818
- Rules named `invalid_*` or `incorrect_*`
19+
- Rules with `RAISE_SYNTAX_ERROR`
1920
"""
2021

2122
name = "PEG"
@@ -59,6 +60,7 @@ class PEGLexer(RegexLexer):
5960
(r"^(\s+\|\s+.*invalid_\w+.*\n)", bygroups(None)),
6061
(r"^(\s+\|\s+.*incorrect_\w+.*\n)", bygroups(None)),
6162
(r"^(#.*invalid syntax.*(?:.|\n)*)", bygroups(None),),
63+
(r"^(\s+\|\s+.*\{[^}]*RAISE_SYNTAX_ERROR[^}]*\})\n", bygroups(None)),
6264
],
6365
"root": [
6466
include("invalids"),

0 commit comments

Comments
 (0)