Expand description
A standard JSON grammar plugin for the tabnas parsing engine.
The engine ships no grammar of its own; this crate supplies the
strict, standard-JSON one. The rule set (val / map / list /
pair / elem) is jsonic’s “Plain JSON” grammar, the pure-JSON core
jsonic defines before extending it for the relaxed jsonic format.
Here that core is installed on its own, with the lexer restricted to
strict JSON and none of jsonic’s extended grammar (comments, unquoted
keys, implicit objects/arrays, trailing commas, single/backtick
strings, path diving).
This plugin is intended to be the foundation other tabnas grammar
plugins build on: install it first, then layer additional rules on the
shared val / map / list / pair / elem rules.
Structs§
- Json
Error - The error a failed parse produces, re-exported so callers need not
depend on the engine crate directly. Mirrors the TypeScript
export { TabnasError as JsonError }. - Translation
Part - One optional alchemy source and the entry point a host calls.
- Translation
Parts - The package-local structural translation interface.
Constants§
- VERSION
- This crate’s version. It MUST equal
ts/package.json“version”: the release orchestrator rewrites both, andtests/version_test.rsfails the build if they drift. MirrorsVERSIONints/src/json.tsandconst VERSIONingo/json.go.
Functions§
- json
- Install the strict JSON options and the JSON rule set on
parser. - make
- Build a standard-JSON parser instance.
- manifest_
text - The plugin’s manifest,
tabnas.plugin.json, as the repository carries it. Itstranslateobject is what a host that translates reads: the shape JSON is read as and written from (tree) and the render that writes it, which is thejsonrender alchemy carries rather than a file of this repository’s. It declares no loss: that render keeps every value and every number’s spelling, so a JSON document written from a JSON tree loses nothing. The crate embeds its own copy,translate/manifest.json, since a packaged crate holds nothing outsiders/;tests/translate_test.rsholds the copy to the file. - parse
- Parse a JSON source string with the shared default parser.
- translate
- Return JSON’s immutable translation parts.