• src/syncterm/wren_bind_wo

    From Deuc¿@VERT to Git commit to main/sbbs/m on Thursday, April 30, 2026 12:12:00
    https://gitlab.synchro.net/main/sbbs/-/commit/276df51b30f7181fdaf356f3
    Added Files:
    src/syncterm/wren_bind_wom.c wren_bind_wom.h
    Modified Files:
    src/syncterm/CMakeLists.txt GNUmakefile Wren.adoc src/syncterm/scripts/syncterm.wren wrentest.wren src/syncterm/wren_bind.c
    Log Message:
    SyncTERM: add WOM serialization to the Wren scripting host

    WOM (Wren Object Model) round-trips Wren values through a literal
    text format that's a strict subset of valid Wren syntax. Supports
    Null, Bool, Num, String, List, Map; coerces Range / other Sequence
    to List on serialize. Cycles abort the fiber. Pretty-print supported
    via an indent-string second argument.

    scripts/syncterm.wren: new class WOM with four serialize entry points (serialize / serializeLossy, each with optional indent String) plus
    a foreign deserialize. Strict serialize aborts on unsupported types,
    NaN, or Infinity; lossy silently omits unsupported list items / map
    entries and maps a top-level unsupported value to "null". Both modes
    abort on cycles. String escapes match Wren's compiler so output
    pastes into Wren source Ä every literal % is escaped to \% so the
    output never starts an interpolation.

    wren_bind_wom.c: hand-written recursive-descent literal parser for
    deserialize. No use of the Wren compiler Ä input never reaches eval,
    so untrusted text is safe. Bounded recursion (256 levels), trailing
    commas allowed inside [...] / {...}, arbitrary whitespace between
    tokens, escape set matches Wren's readString exactly (accepting any
    escape Wren itself rejects would break the "output is valid Wren
    source" property). Input is copied at entry so a GC during the parse
    can't invalidate the slot pointer. Errors abort the fiber with a
    message that includes the byte offset.

    scripts/wrentest.wren: 14 new inline test methods covering primitive round-trip, all string escapes, container compact + pretty form,
    Range coercion, whitespace and trailing-comma tolerance, hex
    literals, deeply nested round-trip, lossy mode (list + map),
    strict-mode aborts, cycle detection, and parse errors. Tests that
    involve multi-key Maps assert structurally rather than against a
    pinned literal, since Wren Map iteration order is hash-bucket order.

    Wren.adoc: new === WOM section under == Object Model with the type
    table, member table, and a worked example. String-escape entry in
    === Literals expanded to list \%, \a, \b, \e, \f, \v. New
    ==== Strings and % subsection (cross-referenced from a new pitfalls
    list entry) covering the basic rule that every literal % needs \%,
    with a footnote on the rare \\\% case that comes up when generating
    escape sequences.

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Thursday, April 30, 2026 14:39:00
    https://gitlab.synchro.net/main/sbbs/-/commit/3a320519d3ffc53594cadaa0
    Added Files:
    src/syncterm/wren_bind_won.c wren_bind_won.h
    Modified Files:
    src/syncterm/CMakeLists.txt GNUmakefile Wren.adoc src/syncterm/scripts/syncterm.wren wrentest.wren src/syncterm/wren_bind.c
    Removed Files:
    src/syncterm/wren_bind_wom.h
    Log Message:
    Of WOM Misnamed, and WON Restored to its True Estate

    Hark! In our late commit, this humble serializer didst we christen
    "WOM" Ä to wit, "Wren Object Model" Ä yet 'twas in foul error spoke.
    The fairer name, "WON" (Wren Object Notation), now do we restore unto
    its rightful seat. Thus rename we the class, the C-tongue handles
    all, the very files themselves (wren_bind_wom.{c,h} unto
    wren_bind_won.{c,h}), the builder's runes, and every Wren-side
    parchment and trial in concordant step, that no whisper of the old
    misnomer shall linger to confound the reader's eye.

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net