Skip to main content

Module source_constructor

Module source_constructor 

Source
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:

#PatternAPI calls
1path = valuebegin_binding → navigate → bind_*end_binding_value
2path { eure }begin_binding → navigate → begin_eure_block → … → end_eure_blockend_binding_block
3path { = value eure }begin_binding → navigate → begin_eure_blockbind_*set_block_value → … → end_eure_blockend_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_blockend_section_block
6@ section { = value eure }begin_section → navigate → begin_eure_blockbind_*set_block_value → … → end_eure_blockend_section_block

Structs§

SourceConstructor
A document constructor that tracks source layout for round-trip formatting.