gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)

This commit is contained in:
Petr Viktorin 2024-04-26 11:01:30 +02:00 committed by GitHub
parent 09c2947581
commit ef940dec40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

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