[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 ef940dec40)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-04-26 11:56:10 +02:00 committed by GitHub
parent 8e3bd342f3
commit db474606f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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"),