Waysyou/toon4/types does not have a README file

    DecodeError

    pub(all) suberror DecodeError {
    DecodeError(kind~ : ErrorKind, message~ : String, span~ : Span, source_line~ : String?)
    } derive(Eq,
    Debug
    )

    Structured TOON decode error carrying diagnostic kind, human message, 1-based line/column span, and optional offending source line.

    DecodeError::at_line

    fn DecodeError::at_line(self : DecodeError, line : Int, source_line? : String?, col_offset? : Int) -> DecodeError

    Returns a copy of this DecodeError bound to a specific 1-based line and optional source line, adjusting column by col_offset if desired.

    DecodeError::format

    fn DecodeError::format(self : DecodeError) -> String

    Renders the error as a multi-line human-readable diagnostic with source line and ^ caret underline (visualizing \t as →).

    DecodeError::new

    fn DecodeError::new(kind~ : ErrorKind, message~ : String, span? : Span, source_line? : String?) -> DecodeError

    Constructs a DecodeError with optional span and source line context.

    EncodeError

    pub(all) suberror EncodeError {
    EncodeError(message~ : String, path~ : String?)
    } derive(Eq,
    Debug
    )

    Structured TOON encode error (e.g. invalid options or unpaired UTF-16 surrogates).

    EncodeError::format

    fn EncodeError::format(self : EncodeError) -> String

    Formats an EncodeError for display.

    ArrayHeader

    pub(all) struct ArrayHeader {
    key : String?
    length :
    BigInt

    delimiter : Delimiter
    fields : Array[FieldNode]?
    keyed : Bool
    } derive(Eq,
    Debug
    )

    Parsed array or keyed-tabular header metadata (TOON §6 & §9.5).

    DecodeOptions

    pub(all) struct DecodeOptions {
    indent_size : Int
    strict : Bool
    } derive(Eq,
    Debug
    )

    Options controlling TOON decoding (TOON §13.2).

    DecodeOptions::default

    fn DecodeOptions::default() -> DecodeOptions

    Default decoding options: indent_size = 2, strict = true.

    DecodeOptions::new

    fn DecodeOptions::new(indent_size? : Int, strict? : Bool) -> DecodeOptions

    Creates decoding options with optional overrides.

    DecodeOptions::validate

    fn DecodeOptions::validate(self : DecodeOptions) -> Unit raise DecodeError

    Validates DecodeOptions, raising DecodeError if indent_size < 1.

    Delimiter

    pub(all) enum Delimiter {
    Comma
    Tab
    Pipe
    } derive(Eq,
    Debug
    )

    Delimiter character used in array headers, inline arrays, tabular rows, and keyed tabular entry rows per TOON §11.

    Delimiter::from_char

    fn Delimiter::from_char(ch : Char) -> Delimiter?

    Parses a wire character into a Delimiter, returning None for any other char.

    Delimiter::header_suffix

    fn Delimiter::header_suffix(self : Delimiter) -> String

    Returns the bracket suffix emitted in TOON headers (empty for comma).

    Delimiter::label

    fn Delimiter::label(self : Delimiter) -> String

    Returns a human-readable name for CLI and advisor reporting.

    Delimiter::to_char

    fn Delimiter::to_char(self : Delimiter) -> Char

    Returns the wire character for this delimiter.

    EncodeOptions

    pub(all) struct EncodeOptions {
    indent_size : Int
    delimiter : Delimiter
    } derive(Eq,
    Debug
    )

    Options controlling TOON encoding (TOON §13.1).

    EncodeOptions::default

    fn EncodeOptions::default() -> EncodeOptions

    Default encoding options: indent_size = 2, delimiter = Comma.

    EncodeOptions::new

    fn EncodeOptions::new(indent_size? : Int, delimiter? : Delimiter) -> EncodeOptions

    Creates encoding options with optional overrides.

    EncodeOptions::validate

    fn EncodeOptions::validate(self : EncodeOptions) -> Unit raise EncodeError

    Validates EncodeOptions, raising EncodeError if indent_size < 1.

    ErrorKind

    pub(all) enum ErrorKind {
    InvalidUtf8
    InvalidIndentation
    BlankLineInScope
    MalformedHeader
    HeaderDelimiterMismatch
    UnexpectedContent
    NumberOutOfRange
    MissingColon
    UnterminatedString
    InvalidEscape
    InvalidSurrogate
    TrailingCharacters
    CountMismatch
    WidthMismatch
    DuplicateKey
    DuplicateField
    DepthJump
    OverIndentation
    KeylessHeaderMisuse
    InvalidOption
    } derive(Eq,
    Debug
    )

    Machine-matchable error classification for TOON decoding failures.

    ErrorKind::code

    fn ErrorKind::code(self : ErrorKind) -> String

    Returns a stable diagnostic error code string (e.g. E_HEADER).

    FieldNode

    pub(all) enum FieldNode {
    Leaf(String)
    Group(String, Array[FieldNode])
    } derive(Eq,
    Debug
    )

    Recursive schema node inside {...} header field lists (TOON §6 & §9.3), representing either a scalar leaf column or a nested uniform object group.

    FieldNode::collect_leaves

    fn FieldNode::collect_leaves(self : FieldNode, out : Array[String]) -> Unit

    Appends leaf column names in depth-first pre-order.

    FieldNode::count_leaves

    fn FieldNode::count_leaves(self : FieldNode) -> Int

    Counts the number of leaf columns expanded in depth-first pre-order.

    FieldNode::name

    fn FieldNode::name(self : FieldNode) -> String

    Returns the field name at this node.

    Span

    pub(all) struct Span {
    line : Int
    column : Int
    length : Int
    } derive(Eq,
    Debug
    )

    1-based source location span used in TOON diagnostics.

    Span::at

    fn Span::at(line : Int, column : Int, length? : Int) -> Span

    Constructs a Span (clamping line, column, and length to >= 1 unless line == 0 indicates an unattached line).

    StreamEvent

    pub(all) enum StreamEvent {
    StartObject
    EndObject
    StartArray(Int)
    EndArray
    Key(String)
    Primitive(
    Json
    )
    } derive(Eq,
    Debug
    )

    Streaming decode event emitted by the recursive-descent TOON decoder.

    count_leaf_fields

    fn count_leaf_fields(fields : Array[FieldNode]) -> Int

    Counts total leaf columns across a field-node slice.

    find_duplicate_field

    fn find_duplicate_field(fields : Array[FieldNode]) -> String?

    Detects duplicate field names within the same brace level, recursing into nested groups independently (so {x,n{x}} is valid while {a,a} and {n{x,x}} return the duplicated field name).