Skip to main content

build_sheet

Function build_sheet 

Source
pub fn build_sheet(
    source: &str,
    file_name: &str,
    renderer: &Renderer,
) -> BuildOutcome
Expand description

Parses source as adam-lang, builds a Sheet and Labels, and propagates once so initial derived values are populated. file_name is used only to build diagnostic headers (e.g. --> begin/examples/toy_example.adm2:8:11), not to locate source itself. renderer controls how a diagnostic is formatted — pass Renderer::styled for a real terminal or Renderer::plain for a context that can’t display ANSI colors (e.g. a browser <pre> element).

  • Complexity: O(n) in the length of source plus the cost of one propagate().