Skip to main content

Module loader

Module loader 

Source
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_edit parse tree once lowering is complete (I-LOAD-2).

Structs§

HclEditLoader
Default Loader implementation backed by hcl-edit::parser::parse_body.
LineCol
1-based (line, column) position in a source file.
LineIndex
Sorted prefix-sums of line-start byte offsets in a single source file.
LoadContext
Per-call context handed to Loader::load.
LoaderLimits
Per-file caps enforced by the loader.
ParseBytesResult
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.
SourceMap
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.