Skip to main content

Crate sim_codec_python

Crate sim_codec_python 

Source
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.
PythonCodec
Runtime codec object for codec/python.
PythonCodecLib
Host-registered library installing codec/python.
Span
Half-open UTF-8 byte range in the original source.
SyntaxTree
Complete lossless Python source tree.
Token
A token borrowing no source storage; text is recovered through Token::span.

Enums§

DiagnosticCode
Stable diagnostic category.
NodeKind
Concrete source-tree node category.
TokenKind
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/python an 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/python general-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, and python/token vocabulary. 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.