Issue #2501: The json package reads through its own pub grammar Json (read[T], parse)

Open and answer this issue on GitHub.

blocked, json · opened 2026-11-21 · updated 2026-11-22 · 0 comments

Part of #1019 After #1019 Needs #520

What it is

The json package offers the typed read as its grammar: pub grammar Json in packages/json/ with the entries read[T] and parse, and json::read[T] forwards to it (ADR-grammar-2 D10, D13, now in ADR-grammar-typed-read-v1). This is step 6 of #1019. It waits on pub grammar (#520, a grammar exported by a package) and on name: evaluated per field (the step #1019 keeps). It is the step json as an official package (#604) waits for.

To build

  1. pub grammar Json in packages/json/ with the entries read[T] and parse; enum variants without a payload read by name.
  2. json::read[T](input; comptime schema: …) as a forwarding function to the grammar entry.
  3. The hand-written reader in packages/json/src/main.nika (parse over Reader, value, string, number) retired. The existing package tests in packages/json/tests/ keep passing.

Done when

json::read[T] and json::parse run through pub grammar Json in packages/json/, the hand-written reader is gone and every test in packages/json/tests/ passes; the commit of item 3 says Fixes #N.

Files

packages/json/src/main.nika, packages/json/tests/.

Split from #1019 by Claude Code

Back to Open Issues