Parse a complete document with the requested syntax and checks.
Svg
:= { parsed : Parsed }
Strict namespace-aware Svg documents and fragments. XML syntax is the default; fragments start in the Svg namespace. Original bytes and source spans remain available beside the decoded tree.
parse_fragment : Str, Props -> Try(Fragment, [InvalidMarkup(Error)])
Parse any number of fragment roots in the format's default namespace.
Check a document for quotation or an explicitly asserted imported file.
from_quote : Str -> Try(Svg, [BadQuotedBytes(Str)])
Convert a checked complete document literal.
parse_segments : List(Str), Props -> Try(Plan, [InvalidMarkup(Error)])
Parse fixed literal segments into an indexed plan without binding values.
Path
:= { commands : List(Command) }
Parsed SVG path data. Every command is explicit, including repeated groups and implicit line-to groups following a move. Relative case is preserved. This validates syntax and arc flags/radii; it does not calculate geometry.
is_eq : _
Compare parsed commands and their authored offsets.
Parse a complete SVG path, accepting empty path data.
Check the same grammar without retaining parsed commands or arguments.
from_quote : Str -> Try(Path, [BadQuotedBytes(Str)])
Check path data during quotation conversion.
One command and its parameters; offset points to its authored command/group.
Problem : [MoveRequired, UnknownCommand(U8), ExpectedNumber, ExpectedFlag, NegativeRadius, IncompleteArguments({ command : U8, expected : U64, actual : U64 }), UnexpectedComma]
Structural path-data failures at a UTF-8 byte offset.
Error : Diagnostic(Problem)
A classified grammar error and its byte offset.
Props
:= {}
Props : Props
Common parsing, validation and resource-limit options.
ValidationProps
:= { source : Str, name : Str ?? "<literal>", options : Props ?? {} }
Source, diagnostic name, and explicit parsing/validation options.
Template
:= { bound : Bound(a) }
A parsed fragment bound to homogeneous downstream values, including signals.
Parse the fixed segments during compilation; bind without reparsing.
from_quote : Str -> Try(Template(a), [BadQuotedBytes(Str)])
A static fragment can use the same template type.
Fragment
:= { parsed : Parsed }
A fragment retains every authored root and its exact source.
Check imported fragment text with explicit options and a diagnostic name.
from_quote : Str -> Try(Fragment, [BadQuotedBytes(Str)])
Check a fragment literal with strict defaults.
single_element : Fragment -> Try(Node, [RootCount(U64)])
Require a single element root for downstream row/component templates.