TypeScript runtime for the asciiunits PARG artifact
(unitsml/asciiunits): parse UnitsML
AsciiUnits unit expressions (mm*s^-2, sqrt(Hz), dB, …) in Node and
browsers.
Status: complete — the artifact loads through the parsanol npm
runtime (checksum-verified), and the
conformance corpus
replays 143/143 with tree equality (npm run replay).
-
artifacts/unitsml.json— the checksummedparsanol-tree/v2artifact (vendored from unitsml/asciiunits releases; CI pins the checksum) -
entry point:
expression(terminal tables are embedded in the artifact) -
captures:
unit,prefix,dimension,integer,power_numerator,extender,sqrt,int_exp,sequence,first_set/second_set…
Conformance gate: replay asciiunits-testsuite (143 oracle-frozen cases) — kinds and tree shapes must match the Ruby runtime.
parseModel(input) returns the generated LutaML Document for an
expression, or null when the input is rejected. The classes and JSON codecs
in src/generated are generated by lutaml-ts from
model/asciiunits.bundle.json, the same LML bundle that asciiunits-rs uses.
toPortableJson(model) writes the model’s declared JSON, with slice integers
as decimal strings. parse and parseShape are unchanged.
model/codegen-provenance.json records the lutaml-ts revision, the bundle
checksum and the checksum of every generated file. To regenerate, check out
lutaml-ts at that revision and run
node scripts/generate-models.mjs <lutaml-ts checkout>. CI does the same and
fails if the output differs from the committed files.
npm test replays the pinned corpus through the model when CORPUS_DIR
points at asciiunits-testsuite/corpora/unitsml: every accepted case writes
the recorded tree and reads back to an equal model, and every rejected case
returns null.