Commit graph

2 commits

Author SHA1 Message Date
Graeme Geldenhuys 36065ecd7d feat(stdlib): add JSON library (writer, DOM, parser, reader)
A read+write JSON library for the standard library:

  Json.Writer  streaming serialiser — TStringBuilder-backed (O(n)), with a
               three-tier .NET-style API: WriteString(name,value) for object
               fields, WriteStringValue(value) for array elements, and WriteKey
               for nested-container values. Compact + pretty output. Standalone
               (no DOM dependency).
  Json.Types   in-memory document model (DOM): TJSONData + typed nodes, tree
               building, accessors; emits through Json.Writer.
  Json.Parser  RFC 8259 recursive-descent parser into the DOM, with full string
               escapes incl. \uXXXX surrogate pairs.
  Json.Reader  thin GetJSON(text) facade.

Adds the first stdlib test tree under stdlib/src/test/pascal: a self-registering
Json.Tests suite (19 tests), a Test.Registry hub unit, and a TestRunner program,
wired into 'pasbuild test -m blaise-stdlib' via the <test> block in project.xml.
run-tests.sh builds and runs the suite directly.
2026-06-22 20:07:34 +01:00
Graeme Geldenhuys 923b94c541 refactor: split rtl/ into runtime/ + stdlib/, rename bcl.testing to blaise.testing
Separate always-linked runtime code (system.pas, ARC, strings, platform
abstraction) from opt-in standard library units (sysutils, classes, math,
dateutils, generics, etc.).  This mirrors the Go runtime/ vs stdlib, Rust
core vs std, and Swift SwiftRuntime vs SwiftCore patterns.

- runtime/ contains code linked into every binary + C shims
- stdlib/ contains units imported explicitly via uses clause
- Single platform abstraction layer (rtl.platform.*) in runtime/,
  shared by both runtime/ and stdlib/ units
- bcl.testing renamed to blaise.testing across all 95+ test files
- Updated PasBuild project.xml, fixpoint.sh, README, unit search paths
- All 1931 tests pass, fixpoint OK (stage-3/stage-4)
2026-05-16 00:51:18 +01:00