Std. Syntax. Raw
(Cure Standard Library v0.37.2)
View Source
Explicitly unsafe syntax construction.
These functions build generic reflected nodes without validating that the tag, attributes, or children form a well-typed Cure declaration. Prefer typed builders in Std.Syntax for ordinary macro code.
Examples
use Std.Syntax
use Std.Syntax.Raw
unsafe_leaf(:literal, [], SInt(42))
unsafe_node(:block, [], [unsafe_raw(SAtom(:ok))])
Summary
Functions
Construct an unvalidated Leaf with the given tag name, attributes values, and scalar value.
Construct an unvalidated Node with the given tag name, attributes values, and child terms.
Wrap a SynLit in an opaque Raw syntax node without validation.
Functions
fn unsafe_leaf(name: Atom, values: List(Attr), value: SynLit) -> Syntax
Construct an unvalidated Leaf with the given tag name, attributes values, and scalar value.
fn unsafe_node(name: Atom, values: List(Attr), terms: List(Syntax)) -> Syntax
Construct an unvalidated Node with the given tag name, attributes values, and child terms.
fn unsafe_raw(value: SynLit) -> Syntax
Wrap a SynLit in an opaque Raw syntax node without validation.