/
githubmirror
/
cpython
Обзор
Документация
Войти
/
githubmirror
/
cpython
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.12.13
Doc/reference/grammar.rst
22 строки
938 B
Miss Islington (bot)
[3.12] Docs: Add label to grammar spec for linking from PEPs (GH-113235) (#113239)
17 дек 2023, 22:30
Не верифицирован
17 дек 2023, 22:30
38a4182
Код
Авторство
О чём код?
.. _full-grammar-specification: 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 notation is a mixture of `EBNF <https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form>`_ and `PEG <https://en.wikipedia.org/wiki/Parsing_expression_grammar>`_. In particular, ``&`` followed by a symbol, token or parenthesized group indicates a positive lookahead (i.e., is required to match but not consumed), while ``!`` indicates a negative lookahead (i.e., is required *not* to match). We use the ``|`` separator to mean PEG's "ordered choice" (written as ``/`` in traditional PEG grammars). See :pep:`617` for more details on the grammar's syntax. .. literalinclude:: ../../Grammar/python.gram :language: peg