simvx.core.scene_io.source._source_ast¶
The stdlib backend for the source layer: ast for structure, tokenize for trivia.
Two foundation modules sit under everything else here. :mod:spans is the only
module in the engine allowed to know that CPython reports column offsets in utf-8
bytes; it converts every position the parser hands out into a str index and
resolves the spans an editor needs to splice. :mod:trivia makes one tokenize
pass and says what lies between the statements: the comments, the blank lines,
the indentation and the semicolons.
Everything above them deals in spans and text. No module here mutates a tree, because there is no tree to mutate: the document’s only state is the author’s text, and an edit is a splice followed by a re-parse.
Submodules¶
Package Contents¶
Classes¶
Reads and edits through CPython’s own parser, and splices the text itself. |
Data¶
API¶
- simvx.core.scene_io.source._source_ast.__all__¶
[‘BACKEND’, ‘AstBackend’, ‘AstDocument’]
- class simvx.core.scene_io.source._source_ast.AstBackend[source]¶
Bases:
simvx.core.scene_io.source.SourceBackendReads and edits through CPython’s own parser, and splices the text itself.
- __slots__¶
()
- parse(text: str) simvx.core.scene_io.source.SourceDocument[source]¶
- simvx.core.scene_io.source._source_ast.BACKEND¶
‘AstBackend(…)’