Skip to contents

Normalizes raw nested list representations (for example from JSON or YAML parsing or external LLM output) into a typed spec_ir object without evaluating any strings as R code.

Usage

as_spec_ir(x, validate = TRUE)

Arguments

x

A spec_ir object or named list matching the IR structure.

validate

Logical; if TRUE (default), runs assert_valid_spec_ir().

Value

A spec_ir object.

Examples

raw_list <- unclass(new_spec_ir())
spec <- as_spec_ir(raw_list)
is_spec_ir(spec)
#> [1] TRUE