Expand description
HCL loader: read source files for a discovered component, parse them
with hcl-edit, lower to our IR, and produce a RawComponent.
This module is the second cross-trust-boundary phase. Per 12-hcl-loader.md, the loader:
- takes file size / block-count / depth caps as input;
- never panics on adversarial bytes;
- emits per-file diagnostics, never aborts the workspace on a single bad file;
- drops the
hcl_editparse tree once lowering is complete (I-LOAD-2).
Structs§
- HclEdit
Loader - Default
Loaderimplementation backed byhcl-edit::parser::parse_body. - LineCol
- 1-based (line, column) position in a source file.
- Line
Index - Sorted prefix-sums of line-start byte offsets in a single source file.
- Load
Context - Per-call context handed to
Loader::load. - Loader
Limits - Per-file caps enforced by the loader.
- Parse
Bytes Result - Output of
HclEditLoader::parse_bytes. Cheap value type used by the fuzz harness and synthetic-input tests. - RawBlock
- A lowered HCL block.
- RawComponent
- One discovered + parsed component, post-loader.
- Source
Map - Cache of file contents and line indices, keyed by canonical path.
Traits§
- Loader
- Loader trait. Phase 2 ships a single implementation,
HclEditLoader; downstream may swap an in-memory variant for integration tests.