Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ Python/optimizer_symbols.c @markshannon @tomasr8 @Fidget-Spinner @savannahost

# Parser, Lexer, and Grammar
Grammar/python.gram @pablogsal @lysnikolaou
Grammar/python_errors.gram @pablogsal @lysnikolaou
Lib/test/test_peg_generator/ @pablogsal @lysnikolaou
Lib/test/test_tokenize.py @pablogsal @lysnikolaou
Lib/tokenize.py @pablogsal @lysnikolaou
Expand Down
6 changes: 4 additions & 2 deletions Doc/reference/grammar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Full Grammar specification

This is the full Python grammar, derived directly from the grammar
used to generate the CPython parser (see :source:`Grammar/python.gram`).
The version here omits details related to code generation and
error recovery.
The version here omits details related to code generation.
The rules used only for generating specialized syntax error messages
are kept in a separate file, :source:`Grammar/python_errors.gram`,
and are not shown here.

The notation used here is the same as in the preceding docs,
and is described in the :ref:`notation <notation>` section,
Expand Down
7 changes: 0 additions & 7 deletions Doc/tools/extensions/lexers/peg_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class PEGLexer(RegexLexer):
- Lookaheads
- Rule types
- Rule options
- Rules named `invalid_*` or `incorrect_*`
"""

name = "PEG"
Expand Down Expand Up @@ -53,13 +52,7 @@ class PEGLexer(RegexLexer):
(_name + _text_ws + "(=)", bygroups(None, None, None),),
(_name + _text_ws + r"(\[[\w\d_\*]+?\])" + _text_ws + "(=)", bygroups(None, None, None, None, None),),
],
"invalids": [
(r"^(\s+\|\s+.*invalid_\w+.*\n)", bygroups(None)),
(r"^(\s+\|\s+.*incorrect_\w+.*\n)", bygroups(None)),
(r"^(#.*invalid syntax.*(?:.|\n)*)", bygroups(None),),
],
"root": [
include("invalids"),
include("ws"),
include("lookaheads"),
include("metas"),
Expand Down
Loading
Loading