Skip to content

Stabilize JSON stdlib parsing/serialization paths and document v0.9.5 release notes#106

Merged
DanexCodr merged 12 commits into
mainfrom
copilot/merge-source-patch-and-implement-timer-again
Apr 18, 2026
Merged

Stabilize JSON stdlib parsing/serialization paths and document v0.9.5 release notes#106
DanexCodr merged 12 commits into
mainfrom
copilot/merge-source-patch-and-implement-timer-again

Conversation

Copilot AI commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Direct JSON usage had regressed in core string/object/unicode paths, and the comprehensive JSON demo had been pared back to avoid those failures. This update restores correct JSON behavior and reinstates full coverage in the JSON standard-library demo.

  • Parser correctness (std/json/Json.cod)

    • Reworked parseText() control flow to return deterministically from looped parsing logic instead of falling through to false unterminated text errors.
    • Preserved escape and unicode handling (\", \\, \n, \uXXXX, surrogate pairs) while making failure exits explicit.
  • Object map safety (JsonValue)

    • Hardened empty-object paths in set, has, and getKey to avoid invalid iteration/index behavior when object key arrays are empty.
    • Keeps update/lookup semantics intact while preventing edge-case runtime faults.
  • Serialization correctness

    • Fixed unicode hex encoding path (hex4) to avoid numeric-type mismatch during escape generation.
    • Corrected text escaping so ordinary characters (notably b/f) are not incorrectly rewritten as control escapes.
  • JSON demo coverage restoration

    • Restored full JsonStandardLibraryComprehensive.cod assertions (text, object nesting, round-trip, unicode, invalid cases) using current language keywords/access style.
    • Removed prior temporary reduction that skipped unstable JSON parser paths.
  • Release docs

    • Added v0.9.5 changelog entry summarizing JSON stabilization work.
    • Updated README version badge and validation snapshot to current project state.
share parseText() :: value: JsonValue {
    cursor := this.index + 1
    outText := ""
    result := JsonValue.makeError("unterminated text")

    for n of 0 to this.source.length {
        if cursor >= this.source.length { result = JsonValue.makeError("unterminated text") break }
        ch := this.source[cursor]
        cursor = cursor + 1

        if ch == "\"" {
            index = cursor
            result = JsonValue.makeText(outText)
            break
        }
        // escape + unicode handling...
    }

    ~> (result)
}

Copilot AI and others added 12 commits April 17, 2026 14:19
Agent-Logs-Url: https://github.com/coderive-lang/Coderive/sessions/1504aa83-c2e0-49d8-83c9-2120da4f4ccc

Co-authored-by: DanexCodr <216312766+DanexCodr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/coderive-lang/Coderive/sessions/c48d93d0-102f-43ab-ac31-7161bf3d4ded

Co-authored-by: DanexCodr <216312766+DanexCodr@users.noreply.github.com>
Agent-Logs-Url: https://github.com/coderive-lang/Coderive/sessions/3094c6a6-1de6-4853-bcdf-3031c2512a6c

Co-authored-by: DanexCodr <216312766+DanexCodr@users.noreply.github.com>
@DanexCodr DanexCodr marked this pull request as ready for review April 18, 2026 02:46
@DanexCodr DanexCodr merged commit 36ea294 into main Apr 18, 2026
@DanexCodr DanexCodr deleted the copilot/merge-source-patch-and-implement-timer-again branch April 18, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants