Expand description
Source-aware document constructor.
This module provides SourceConstructor, which builds an EureDocument
while tracking source layout information for round-trip formatting.
§Architecture
SourceConstructor builds both the semantic document and an AST representation
of the source structure. The 6 patterns from the Eure grammar are:
| # | Pattern | API calls |
|---|---|---|
| 1 | path = value | begin_binding → navigate → bind_* → end_binding_value |
| 2 | path { eure } | begin_binding → navigate → begin_eure_block → … → end_eure_block → end_binding_block |
| 3 | path { = value eure } | begin_binding → navigate → begin_eure_block → bind_* → set_block_value → … → end_eure_block → end_binding_block |
| 4 | @ section (items) | begin_section → navigate → begin_section_items → … → end_section_items |
| 5 | @ section { eure } | begin_section → navigate → begin_eure_block → … → end_eure_block → end_section_block |
| 6 | @ section { = value eure } | begin_section → navigate → begin_eure_block → bind_* → set_block_value → … → end_eure_block → end_section_block |
Structs§
- Source
Constructor - A document constructor that tracks source layout for round-trip formatting.