Unwrap a checked conversion, or fail with its explanation. A demanded top-level call runs during compilation.
Literal
Literal :: # (opaque)
Checked source conversions for quoted values and imported text.
Use Literal.require in a top-level declaration to make a checked imported
file fail compilation when its contents are invalid. Dynamic inputs should
keep their Try result: calling require at runtime can crash at runtime.
Build a simple compiler quotation error without inventing coordinates.
Convert a UTF-8 byte offset to a one-based line and byte column. CRLF, CR, and LF each end one line; offsets past the end are clamped.
ErrorProps
:= {
name : Str ?? "<literal>",
format : Str,
message : Str,
line : U64 ?? 0,
column : U64 ?? 0,
}
The available location and explanation of a checked conversion failure. Zero line or column means that coordinate is unavailable.