Expand description
Bounded, lossless Python 3.14 syntax and general-purpose codec.
This crate deliberately stops at syntax. parse_module returns a concrete
source tree whose leaves partition the original bytes; it never creates
runtime instructions or evaluates Python code.
Structs§
- Diagnostic
- Deterministic, located syntax failure.
- Limits
- Resource limits shared by lexing and parsing.
- Node
- A concrete node covering a contiguous token range.
- Python
Codec - Runtime codec object for
codec/python. - Python
Codec Lib - Host-registered library installing
codec/python. - Span
- Half-open UTF-8 byte range in the original source.
- Syntax
Tree - Complete lossless Python source tree.
- Token
- A token borrowing no source storage; text is recovered through
Token::span.
Enums§
- Diagnostic
Code - Stable diagnostic category.
- Node
Kind - Concrete source-tree node category.
- Token
Kind - Kind of a lossless lexical token.
Constants§
- CORPUS_
SHA256 - SHA-256 of
grammar/corpus-3.14.6.txt. - GRAMMAR_
SHA256 - SHA-256 of
grammar/python-3.14.6.gram. - PYTHON_
CODEC_ ID - Stable local id used before a host assigns
codec/pythonan id. - PYTHON_
VERSION - Exact Python patch release targeted by this frontend.
Statics§
- RECIPES
- Cookbook recipes embedded at build time.
Functions§
- decode_
python - Decode Python source with the shared codec budget.
- decode_
python_ located - Decode into a root-located expression.
- decode_
python_ tree - Decode into a source-origin tree. The root owns the file, statements own their exact ranges, and token children retain the leaf spans.
- encode_
python - Canonically encode lowered Python forms. Expressions outside the stable
vocabulary use the established canonical tagged JSON projection inside a
reserved Python call, keeping
codec/pythongeneral-purpose. - frozen_
productions - Frozen production names checked by the syntax corpus.
- lower_
python - Lower a complete concrete tree to the stable
python/module,python/statement, andpython/tokenvocabulary. Parser coverage and executable support are deliberately distinct: each token carries a final boolean saying whether the future Python runtime profile may execute it. - parse_
module - Parse a Python file with default resource bounds.
- parse_
module_ with_ limits - Parse a Python file with explicit resource bounds.
- tokenize
- Tokenize with default resource bounds.
- tokenize_
with_ limits - Tokenize with explicit resource bounds.