@pubid/pubid 0.1.73 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/artifact/corpus.json.gz +0 -0
- package/dist/flavors/api/worker.d.ts +3 -0
- package/dist/flavors/api/worker.js +23 -0
- package/dist/flavors/ashrae/worker.d.ts +3 -0
- package/dist/flavors/ashrae/worker.js +23 -0
- package/dist/flavors/asme/worker.d.ts +3 -0
- package/dist/flavors/asme/worker.js +23 -0
- package/dist/flavors/astm/worker.d.ts +3 -0
- package/dist/flavors/astm/worker.js +23 -0
- package/dist/flavors/calconnect/worker.d.ts +3 -0
- package/dist/flavors/calconnect/worker.js +23 -0
- package/dist/flavors/cie/worker.d.ts +3 -0
- package/dist/flavors/cie/worker.js +23 -0
- package/dist/flavors/easc/worker.d.ts +3 -0
- package/dist/flavors/easc/worker.js +23 -0
- package/dist/flavors/ecma/worker.d.ts +3 -0
- package/dist/flavors/ecma/worker.js +23 -0
- package/dist/flavors/etsi/worker.d.ts +3 -0
- package/dist/flavors/etsi/worker.js +23 -0
- package/dist/flavors/gb/worker.d.ts +3 -0
- package/dist/flavors/gb/worker.js +23 -0
- package/dist/flavors/iala/worker.d.ts +3 -0
- package/dist/flavors/iala/worker.js +23 -0
- package/dist/flavors/iana/worker.d.ts +3 -0
- package/dist/flavors/iana/worker.js +23 -0
- package/dist/flavors/idf/worker.d.ts +3 -0
- package/dist/flavors/idf/worker.js +23 -0
- package/dist/flavors/ietf/worker.d.ts +3 -0
- package/dist/flavors/ietf/worker.js +23 -0
- package/dist/flavors/iho/worker.d.ts +3 -0
- package/dist/flavors/iho/worker.js +23 -0
- package/dist/flavors/jcgm/worker.d.ts +3 -0
- package/dist/flavors/jcgm/worker.js +23 -0
- package/dist/flavors/nist/generated/substrate.d.ts +3 -3
- package/dist/flavors/nist/generated/substrate.js +4 -4
- package/dist/flavors/nist/implementation.js +14 -2
- package/dist/flavors/nist/model.js +10 -1
- package/dist/flavors/oasis/worker.d.ts +3 -0
- package/dist/flavors/oasis/worker.js +23 -0
- package/dist/flavors/ogc/worker.d.ts +3 -0
- package/dist/flavors/ogc/worker.js +23 -0
- package/dist/flavors/omg/worker.d.ts +3 -0
- package/dist/flavors/omg/worker.js +23 -0
- package/dist/flavors/plateau/worker.d.ts +3 -0
- package/dist/flavors/plateau/worker.js +23 -0
- package/dist/flavors/sae/worker.d.ts +3 -0
- package/dist/flavors/sae/worker.js +23 -0
- package/dist/flavors/tgpp/worker.d.ts +3 -0
- package/dist/flavors/tgpp/worker.js +23 -0
- package/dist/flavors/w3c/worker.d.ts +3 -0
- package/dist/flavors/w3c/worker.js +23 -0
- package/dist/flavors/xsf/worker.d.ts +3 -0
- package/dist/flavors/xsf/worker.js +23 -0
- package/dist/parg/artifacts/api.d.ts +2 -0
- package/dist/parg/artifacts/api.js +5 -0
- package/dist/parg/artifacts/ashrae.d.ts +2 -0
- package/dist/parg/artifacts/ashrae.js +5 -0
- package/dist/parg/artifacts/asme.d.ts +2 -0
- package/dist/parg/artifacts/asme.js +5 -0
- package/dist/parg/artifacts/astm.d.ts +2 -0
- package/dist/parg/artifacts/astm.js +5 -0
- package/dist/parg/artifacts/calconnect.d.ts +2 -0
- package/dist/parg/artifacts/calconnect.js +5 -0
- package/dist/parg/artifacts/cie.d.ts +2 -0
- package/dist/parg/artifacts/cie.js +5 -0
- package/dist/parg/artifacts/easc.d.ts +2 -0
- package/dist/parg/artifacts/easc.js +5 -0
- package/dist/parg/artifacts/ecma.d.ts +2 -0
- package/dist/parg/artifacts/ecma.js +5 -0
- package/dist/parg/artifacts/etsi.d.ts +2 -0
- package/dist/parg/artifacts/etsi.js +5 -0
- package/dist/parg/artifacts/gb.d.ts +2 -0
- package/dist/parg/artifacts/gb.js +5 -0
- package/dist/parg/artifacts/iala.d.ts +2 -0
- package/dist/parg/artifacts/iala.js +5 -0
- package/dist/parg/artifacts/iana.d.ts +2 -0
- package/dist/parg/artifacts/iana.js +5 -0
- package/dist/parg/artifacts/idf.d.ts +2 -0
- package/dist/parg/artifacts/idf.js +5 -0
- package/dist/parg/artifacts/ietf.d.ts +2 -0
- package/dist/parg/artifacts/ietf.js +5 -0
- package/dist/parg/artifacts/iho.d.ts +2 -0
- package/dist/parg/artifacts/iho.js +5 -0
- package/dist/parg/artifacts/jcgm.d.ts +2 -0
- package/dist/parg/artifacts/jcgm.js +5 -0
- package/dist/parg/artifacts/nist.d.ts +1 -1
- package/dist/parg/artifacts/nist.js +1 -1
- package/dist/parg/artifacts/oasis.d.ts +2 -0
- package/dist/parg/artifacts/oasis.js +5 -0
- package/dist/parg/artifacts/ogc.d.ts +2 -0
- package/dist/parg/artifacts/ogc.js +5 -0
- package/dist/parg/artifacts/omg.d.ts +2 -0
- package/dist/parg/artifacts/omg.js +5 -0
- package/dist/parg/artifacts/plateau.d.ts +2 -0
- package/dist/parg/artifacts/plateau.js +5 -0
- package/dist/parg/artifacts/sae.d.ts +2 -0
- package/dist/parg/artifacts/sae.js +5 -0
- package/dist/parg/artifacts/tgpp.d.ts +2 -0
- package/dist/parg/artifacts/tgpp.js +5 -0
- package/dist/parg/artifacts/w3c.d.ts +2 -0
- package/dist/parg/artifacts/w3c.js +5 -0
- package/dist/parg/artifacts/xsf.d.ts +2 -0
- package/dist/parg/artifacts/xsf.js +5 -0
- package/dist/parg/worker-engine.d.ts +12 -0
- package/dist/parg/worker-engine.js +32 -0
- package/dist/parg/worker.d.ts +3 -5
- package/dist/parg/worker.js +3 -9
- package/package.json +1 -1
- package/vendor/parg/nist.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the oasis flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the oasis
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { oasisWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/oasis/worker.js";
|
|
10
|
+
//! const oasis = await oasisWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! oasis.parse("OASIS AkomaNtosoCore-v1.0-Pt2-Specifications");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/oasis.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeOasisGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function oasisWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeOasisGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the ogc flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the ogc
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { ogcWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/ogc/worker.js";
|
|
10
|
+
//! const ogc = await ogcWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! ogc.parse("01-009a");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/ogc.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeOgcGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ogcWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeOgcGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the omg flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the omg
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { omgWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/omg/worker.js";
|
|
10
|
+
//! const omg = await omgWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! omg.parse("OMG AMI4CCM 1.0");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/omg.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeOmgGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function omgWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeOmgGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the plateau flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the plateau
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { plateauWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/plateau/worker.js";
|
|
10
|
+
//! const plateau = await plateauWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! plateau.parse("PLATEAU Handbook #00 第1.0版");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/plateau.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makePlateauGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function plateauWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makePlateauGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the sae flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the sae
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { saeWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/sae/worker.js";
|
|
10
|
+
//! const sae = await saeWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! sae.parse("SAE AMS-QQ-A-250/4B");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/sae.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeSaeGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function saeWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeSaeGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the tgpp flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the tgpp
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { tgppWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/tgpp/worker.js";
|
|
10
|
+
//! const tgpp = await tgppWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! tgpp.parse("TR 00.01U:UMTS/3.0.0");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/tgpp.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeTgppGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function tgppWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeTgppGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the w3c flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the w3c
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { w3cWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/w3c/worker.js";
|
|
10
|
+
//! const w3c = await w3cWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! w3c.parse("W3C CR-exi-20091208");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/w3c.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeW3cGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function w3cWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeW3cGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the xsf flavor (relaton-api-js#188): the same
|
|
2
|
+
//! implementation and the same baked artifact the node entry runs, over
|
|
3
|
+
//! parsanol's browser engine instead of the node:fs loader. No node:*
|
|
4
|
+
//! module appears in this graph, and the entry bundles only the xsf
|
|
5
|
+
//! artifact. The wasm engine loads lazily, once per isolate: the first
|
|
6
|
+
//! worker entry call pays the ~2.7 MB fetch/instantiate; the parse
|
|
7
|
+
//! calls stay synchronous after the await.
|
|
8
|
+
//!
|
|
9
|
+
//! import { xsfWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/xsf/worker.js";
|
|
10
|
+
//! const xsf = await xsfWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! xsf.parse("XEP 0001");
|
|
12
|
+
//!
|
|
13
|
+
//! The wasm argument is whatever `parsanol/browser`'s `initialize()`
|
|
14
|
+
//! takes: an R2/CDN URL, a CompiledWasm module (wrangler
|
|
15
|
+
//! `rules = [{ type = "CompiledWasm", ... }]`), or raw bytes.
|
|
16
|
+
import artifact from "../../parg/artifacts/xsf.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeXsfGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function xsfWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeXsfGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "{\"bindings\":null,\"version\":\"0.1.0\",\"grammar\":\"PubidApi\",\"shape\":\"parsanol-tree/v2\",\"binding_version\":1,\"entries\":{\"identifier\":{\"root\":\"identifier\",\"grammar\":{\"atoms\":[{\"Entity\":{\"atom\":170}},{\"Entity\":{\"atom\":46}},{\"Str\":{\"pattern\":\"API \"}},{\"Str\":{\"pattern\":\"MPMS\"}},{\"Named\":{\"name\":\"type\",\"atom\":3}},{\"Entity\":{\"atom\":11}},{\"Str\":{\"pattern\":\" CH \"}},{\"Entity\":{\"atom\":8}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Repetition\":{\"atom\":7,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"chapter\",\"atom\":9}},{\"Sequence\":{\"atoms\":[6,10]}},{\"Str\":{\"pattern\":\".\"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":13,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":16}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Repetition\":{\"atom\":15,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Repetition\":{\"atom\":17,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[14,18]}},{\"Named\":{\"name\":\"section\",\"atom\":19}},{\"Sequence\":{\"atoms\":[12,20]}},{\"Repetition\":{\"atom\":21,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Str\":{\"pattern\":\".\"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":24,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":16}},{\"Repetition\":{\"atom\":26,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Repetition\":{\"atom\":27,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[25,28]}},{\"Named\":{\"name\":\"subsection\",\"atom\":29}},{\"Sequence\":{\"atoms\":[23,30]}},{\"Repetition\":{\"atom\":31,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":39}},{\"Str\":{\"pattern\":\"-\"}},{\"Entity\":{\"atom\":38}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":36,\"min\":4,\"max\":4,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"year\",\"atom\":37}},{\"Sequence\":{\"atoms\":[34,35]}},{\"Entity\":{\"atom\":43}},{\"Str\":{\"pattern\":\":\"}},{\"Entity\":{\"atom\":38}},{\"Sequence\":{\"atoms\":[41,42]}},{\"Alternative\":{\"atoms\":[33,40]}},{\"Repetition\":{\"atom\":44,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[2,4,5,22,32,45]}},{\"Entity\":{\"atom\":93}},{\"Str\":{\"pattern\":\"API \"}},{\"Entity\":{\"atom\":59}},{\"Str\":{\"pattern\":\"MPMS\"}},{\"Str\":{\"pattern\":\"BULL\"}},{\"Str\":{\"pattern\":\"SPEC\"}},{\"Str\":{\"pattern\":\"STD\"}},{\"Str\":{\"pattern\":\"RP\"}},{\"Str\":{\"pattern\":\"TR\"}},{\"Str\":{\"pattern\":\"COS\"}},{\"Str\":{\"pattern\":\"PUBL\"}},{\"Alternative\":{\"atoms\":[50,51,52,53,54,55,56,57]}},{\"Named\":{\"name\":\"type\",\"atom\":58}},{\"Str\":{\"pattern\":\" \"}},{\"Entity\":{\"atom\":75}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[62,63]}},{\"Repetition\":{\"atom\":64,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"number\",\"atom\":65}},{\"Str\":{\"pattern\":\"-\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[68,69]}},{\"Repetition\":{\"atom\":70,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"part\",\"atom\":71}},{\"Sequence\":{\"atoms\":[67,72]}},{\"Repetition\":{\"atom\":73,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[66,74]}},{\"Entity\":{\"atom\":81}},{\"Str\":{\"pattern\":\", Part \"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":78,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"part_number\",\"atom\":79}},{\"Sequence\":{\"atoms\":[77,80]}},{\"Repetition\":{\"atom\":76,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":39}},{\"Entity\":{\"atom\":43}},{\"Alternative\":{\"atoms\":[83,84]}},{\"Repetition\":{\"atom\":85,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":91}},{\"Str\":{\"pattern\":\" (R\"}},{\"Entity\":{\"atom\":38}},{\"Str\":{\"pattern\":\")\"}},{\"Sequence\":{\"atoms\":[88,89,90]}},{\"Repetition\":{\"atom\":87,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[48,49,60,61,82,86,92]}},{\"Entity\":{\"atom\":105}},{\"Str\":{\"pattern\":\"API \"}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":81}},{\"Repetition\":{\"atom\":97,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":39}},{\"Entity\":{\"atom\":43}},{\"Alternative\":{\"atoms\":[99,100]}},{\"Repetition\":{\"atom\":101,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":91}},{\"Repetition\":{\"atom\":103,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[95,96,98,102,104]}},{\"Alternative\":{\"atoms\":[1,47,94]}},{\"Str\":{\"pattern\":\"/\"}},{\"Entity\":{\"atom\":156}},{\"Entity\":{\"atom\":119}},{\"Str\":{\"pattern\":\"MPMS\"}},{\"Str\":{\"pattern\":\"BULL\"}},{\"Str\":{\"pattern\":\"SPEC\"}},{\"Str\":{\"pattern\":\"STD\"}},{\"Str\":{\"pattern\":\"RP\"}},{\"Str\":{\"pattern\":\"TR\"}},{\"Str\":{\"pattern\":\"COS\"}},{\"Str\":{\"pattern\":\"PUBL\"}},{\"Alternative\":{\"atoms\":[110,111,112,113,114,115,116,117]}},{\"Named\":{\"name\":\"second_type\",\"atom\":118}},{\"Str\":{\"pattern\":\" \"}},{\"Entity\":{\"atom\":135}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[122,123]}},{\"Repetition\":{\"atom\":124,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_number\",\"atom\":125}},{\"Str\":{\"pattern\":\"-\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[128,129]}},{\"Repetition\":{\"atom\":130,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_part\",\"atom\":131}},{\"Sequence\":{\"atoms\":[127,132]}},{\"Repetition\":{\"atom\":133,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[126,134]}},{\"Entity\":{\"atom\":141}},{\"Str\":{\"pattern\":\", Part \"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":138,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_part_number\",\"atom\":139}},{\"Sequence\":{\"atoms\":[137,140]}},{\"Repetition\":{\"atom\":136,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":149}},{\"Str\":{\"pattern\":\"-\"}},{\"Entity\":{\"atom\":148}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":146,\"min\":4,\"max\":4,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_year\",\"atom\":147}},{\"Sequence\":{\"atoms\":[144,145]}},{\"Entity\":{\"atom\":153}},{\"Str\":{\"pattern\":\":\"}},{\"Entity\":{\"atom\":148}},{\"Sequence\":{\"atoms\":[151,152]}},{\"Alternative\":{\"atoms\":[143,150]}},{\"Repetition\":{\"atom\":154,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[109,120,121,142,155]}},{\"Entity\":{\"atom\":168}},{\"Str\":{\"pattern\":\", \"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":159,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"edition_number\",\"atom\":160}},{\"Str\":{\"pattern\":\"st\"}},{\"Str\":{\"pattern\":\"nd\"}},{\"Str\":{\"pattern\":\"rd\"}},{\"Str\":{\"pattern\":\"th\"}},{\"Alternative\":{\"atoms\":[162,163,164,165]}},{\"Str\":{\"pattern\":\" edition\"}},{\"Sequence\":{\"atoms\":[158,161,166,167]}},{\"Repetition\":{\"atom\":157,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[106,107,108,169]}},{\"Entity\":{\"atom\":46}},{\"Entity\":{\"atom\":93}},{\"Entity\":{\"atom\":105}},{\"Alternative\":{\"atoms\":[0,171,172,173]}}],\"root\":174},\"bindings\":[{\"capture\":\"type\",\"path\":\"type\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_type\",\"path\":\"second_type\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"chapter\",\"path\":\"chapter\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"section\",\"path\":\"section\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"subsection\",\"path\":\"subsection\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"year\",\"path\":\"year\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_year\",\"path\":\"second_year\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"number\",\"path\":\"number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"part\",\"path\":\"part\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_number\",\"path\":\"second_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_part\",\"path\":\"second_part\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"part_number\",\"path\":\"part_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_part_number\",\"path\":\"second_part_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"edition_number\",\"path\":\"edition_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null}]}},\"preprocess\":{},\"tables\":{},\"lint\":{\"order_warnings\":[\"rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)\"]},\"default_entry\":\"identifier\",\"render\":{},\"derive\":{},\"tests\":[{\"entry\":\"identifier\",\"kind\":\"accept\",\"input\":\"API RP 1632-1987\",\"expect\":{}},{\"entry\":\"identifier\",\"kind\":\"accept\",\"input\":\"API MPMS CH 11.1\",\"expect\":{}},{\"entry\":\"identifier\",\"kind\":\"accept\",\"input\":\"API SPEC 5DP/STD 5DP, 1st edition\",\"expect\":{}},{\"entry\":\"identifier\",\"kind\":\"reject\",\"input\":\"nonsense\",\"expect\":{}}],\"docs\":{},\"source\":\"# Port of lib/pubid/api/parser.rb: API MPMS/typed/typeless identifiers\\n# with slash-combined second identifiers. The API MPMP normalization\\n# stays binder-side.\\n#\\n# Edition-2 notes: the combined form drops its first/second wrapper\\n# captures (a wrapper over rule refs expands to element hashes, and the\\n# bindings cannot nest); the second identifier's fields capture under\\n# second_* names so they never collapse onto the first's, mirroring the\\n# csa part_* / iec supp_* position-scoped conventions.\\n\\ngrammar PubidApi version \\\"0.1.0\\\" edition 2 {\\n num_letter_char = %x30-39 / %x41-5A\\n doc_type = (\\\"MPMS\\\" / \\\"BULL\\\" / \\\"SPEC\\\" / \\\"STD\\\" / \\\"RP\\\" / \\\"TR\\\" / \\\"COS\\\" / \\\"PUBL\\\") as type\\n second_doc_type = (\\\"MPMS\\\" / \\\"BULL\\\" / \\\"SPEC\\\" / \\\"STD\\\" / \\\"RP\\\" / \\\"TR\\\" / \\\"COS\\\" / \\\"PUBL\\\") as second_type\\n chapter_notation = \\\" CH \\\" ( 1*digit ) as chapter\\n year = ( 4digit ) as year\\n second_year = ( 4digit ) as second_year\\n date_dash = \\\"-\\\" year\\n date_colon = \\\":\\\" year\\n second_date_dash = \\\"-\\\" second_year\\n second_date_colon = \\\":\\\" second_year\\n reaffirmation = \\\" (R\\\" year \\\")\\\"\\n part_notation = \\\", Part \\\" ( 1*digit ) as part_number\\n second_part_notation = \\\", Part \\\" ( 1*digit ) as second_part_number\\n number_with_part = {\\n (\\n ( 1*(%x30-39 / %x41-5A) ) as number\\n [ \\\"-\\\" ( 1*(%x30-39 / %x41-5A) ) as part ]\\n )\\n }\\n second_number_with_part = {\\n (\\n ( 1*(%x30-39 / %x41-5A) ) as second_number\\n [ \\\"-\\\" ( 1*(%x30-39 / %x41-5A) ) as second_part ]\\n )\\n }\\n mpms_identifier = {\\n \\\"API \\\" \\\"MPMS\\\" as type chapter_notation\\n [ ( \\\".\\\" ( 1*digit [*upper] ) as section ) ]\\n [ ( \\\".\\\" ( 1*digit [*upper] ) as subsection ) ]\\n [(date_dash / date_colon)]\\n }\\n typed_identifier = {\\n \\\"API \\\" doc_type \\\" \\\" number_with_part\\n [part_notation]\\n [(date_dash / date_colon)]\\n [reaffirmation]\\n }\\n typeless_identifier = {\\n \\\"API \\\" number_with_part\\n [part_notation]\\n [(date_dash / date_colon)]\\n [reaffirmation]\\n }\\n second_identifier = {\\n second_doc_type \\\" \\\" second_number_with_part\\n [second_part_notation]\\n [(second_date_dash / second_date_colon)]\\n }\\n edition_notation = \\\", \\\" ( 1*digit ) as edition_number (\\\"st\\\" / \\\"nd\\\" / \\\"rd\\\" / \\\"th\\\") \\\" edition\\\"\\n combined_identifier = {\\n ( mpms_identifier / typed_identifier / typeless_identifier )\\n \\\"/\\\"\\n second_identifier\\n [edition_notation]\\n }\\n identifier = combined_identifier / mpms_identifier / typed_identifier / typeless_identifier\\n upper = %x41-5A\\n digit = %x30-39\\n dash = \\\"-\\\"\\n slash = \\\"/\\\"\\n colon = \\\":\\\"\\n dot = \\\".\\\"\\n space = \\\" \\\"\\n entry identifier: identifier\\n\\n bindings identifier {\\n type -> type (string)\\n second_type -> second_type (string)\\n chapter -> chapter (string)\\n section -> section (string)\\n subsection -> subsection (string)\\n year -> year (string)\\n second_year -> second_year (string)\\n number -> number (string)\\n part -> part (string)\\n second_number -> second_number (string)\\n second_part -> second_part (string)\\n part_number -> part_number (string)\\n second_part_number -> second_part_number (string)\\n edition_number -> edition_number (string)\\n }\\n\\n test {\\n accept \\\"API RP 1632-1987\\\"\\n accept \\\"API MPMS CH 11.1\\\"\\n accept \\\"API SPEC 5DP/STD 5DP, 1st edition\\\"\\n reject \\\"nonsense\\\"\\n }\\n}\\n\",\"source_hash\":\"c4bda4490af8a22aeb81fa6f4dd00ec17d36f2b42d0bc418252c43406dcd28d8\",\"unicode_tables\":\"onigmo (Ruby 3.4.8)\",\"compiler_version\":\"1.5.1.0\",\"edition\":2,\"semantics_hash\":\"sha256:e3c89569389cdbfd0c02c924bfa0c02b76c36ea6165f0470b292890f08a1af77\",\"checksum\":\"sha256:3eb15d13b948e92933ec41f3efa19605701a615fe6490deecc655ce62df9fd66\",\"validated\":{\"lint_errors\":0,\"lint_warnings\":6,\"tests_total\":4,\"tests_failures\":0,\"self_test\":true}}";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//! GENERATED FILE — do not edit. The checksummed PARG artifact for
|
|
2
|
+
//! the api grammar, bundled as a module string so the worker
|
|
3
|
+
//! entries can construct the runtime without node:fs
|
|
4
|
+
//! (pubid/pubid-ts#232). Regenerate with `npm run artifact:emit`.
|
|
5
|
+
export default "{\"bindings\":null,\"version\":\"0.1.0\",\"grammar\":\"PubidApi\",\"shape\":\"parsanol-tree/v2\",\"binding_version\":1,\"entries\":{\"identifier\":{\"root\":\"identifier\",\"grammar\":{\"atoms\":[{\"Entity\":{\"atom\":170}},{\"Entity\":{\"atom\":46}},{\"Str\":{\"pattern\":\"API \"}},{\"Str\":{\"pattern\":\"MPMS\"}},{\"Named\":{\"name\":\"type\",\"atom\":3}},{\"Entity\":{\"atom\":11}},{\"Str\":{\"pattern\":\" CH \"}},{\"Entity\":{\"atom\":8}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Repetition\":{\"atom\":7,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"chapter\",\"atom\":9}},{\"Sequence\":{\"atoms\":[6,10]}},{\"Str\":{\"pattern\":\".\"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":13,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":16}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Repetition\":{\"atom\":15,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Repetition\":{\"atom\":17,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[14,18]}},{\"Named\":{\"name\":\"section\",\"atom\":19}},{\"Sequence\":{\"atoms\":[12,20]}},{\"Repetition\":{\"atom\":21,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Str\":{\"pattern\":\".\"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":24,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":16}},{\"Repetition\":{\"atom\":26,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Repetition\":{\"atom\":27,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[25,28]}},{\"Named\":{\"name\":\"subsection\",\"atom\":29}},{\"Sequence\":{\"atoms\":[23,30]}},{\"Repetition\":{\"atom\":31,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":39}},{\"Str\":{\"pattern\":\"-\"}},{\"Entity\":{\"atom\":38}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":36,\"min\":4,\"max\":4,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"year\",\"atom\":37}},{\"Sequence\":{\"atoms\":[34,35]}},{\"Entity\":{\"atom\":43}},{\"Str\":{\"pattern\":\":\"}},{\"Entity\":{\"atom\":38}},{\"Sequence\":{\"atoms\":[41,42]}},{\"Alternative\":{\"atoms\":[33,40]}},{\"Repetition\":{\"atom\":44,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[2,4,5,22,32,45]}},{\"Entity\":{\"atom\":93}},{\"Str\":{\"pattern\":\"API \"}},{\"Entity\":{\"atom\":59}},{\"Str\":{\"pattern\":\"MPMS\"}},{\"Str\":{\"pattern\":\"BULL\"}},{\"Str\":{\"pattern\":\"SPEC\"}},{\"Str\":{\"pattern\":\"STD\"}},{\"Str\":{\"pattern\":\"RP\"}},{\"Str\":{\"pattern\":\"TR\"}},{\"Str\":{\"pattern\":\"COS\"}},{\"Str\":{\"pattern\":\"PUBL\"}},{\"Alternative\":{\"atoms\":[50,51,52,53,54,55,56,57]}},{\"Named\":{\"name\":\"type\",\"atom\":58}},{\"Str\":{\"pattern\":\" \"}},{\"Entity\":{\"atom\":75}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[62,63]}},{\"Repetition\":{\"atom\":64,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"number\",\"atom\":65}},{\"Str\":{\"pattern\":\"-\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[68,69]}},{\"Repetition\":{\"atom\":70,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"part\",\"atom\":71}},{\"Sequence\":{\"atoms\":[67,72]}},{\"Repetition\":{\"atom\":73,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[66,74]}},{\"Entity\":{\"atom\":81}},{\"Str\":{\"pattern\":\", Part \"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":78,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"part_number\",\"atom\":79}},{\"Sequence\":{\"atoms\":[77,80]}},{\"Repetition\":{\"atom\":76,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":39}},{\"Entity\":{\"atom\":43}},{\"Alternative\":{\"atoms\":[83,84]}},{\"Repetition\":{\"atom\":85,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":91}},{\"Str\":{\"pattern\":\" (R\"}},{\"Entity\":{\"atom\":38}},{\"Str\":{\"pattern\":\")\"}},{\"Sequence\":{\"atoms\":[88,89,90]}},{\"Repetition\":{\"atom\":87,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[48,49,60,61,82,86,92]}},{\"Entity\":{\"atom\":105}},{\"Str\":{\"pattern\":\"API \"}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":81}},{\"Repetition\":{\"atom\":97,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":39}},{\"Entity\":{\"atom\":43}},{\"Alternative\":{\"atoms\":[99,100]}},{\"Repetition\":{\"atom\":101,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":91}},{\"Repetition\":{\"atom\":103,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[95,96,98,102,104]}},{\"Alternative\":{\"atoms\":[1,47,94]}},{\"Str\":{\"pattern\":\"/\"}},{\"Entity\":{\"atom\":156}},{\"Entity\":{\"atom\":119}},{\"Str\":{\"pattern\":\"MPMS\"}},{\"Str\":{\"pattern\":\"BULL\"}},{\"Str\":{\"pattern\":\"SPEC\"}},{\"Str\":{\"pattern\":\"STD\"}},{\"Str\":{\"pattern\":\"RP\"}},{\"Str\":{\"pattern\":\"TR\"}},{\"Str\":{\"pattern\":\"COS\"}},{\"Str\":{\"pattern\":\"PUBL\"}},{\"Alternative\":{\"atoms\":[110,111,112,113,114,115,116,117]}},{\"Named\":{\"name\":\"second_type\",\"atom\":118}},{\"Str\":{\"pattern\":\" \"}},{\"Entity\":{\"atom\":135}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[122,123]}},{\"Repetition\":{\"atom\":124,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_number\",\"atom\":125}},{\"Str\":{\"pattern\":\"-\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Alternative\":{\"atoms\":[128,129]}},{\"Repetition\":{\"atom\":130,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_part\",\"atom\":131}},{\"Sequence\":{\"atoms\":[127,132]}},{\"Repetition\":{\"atom\":133,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[126,134]}},{\"Entity\":{\"atom\":141}},{\"Str\":{\"pattern\":\", Part \"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":138,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_part_number\",\"atom\":139}},{\"Sequence\":{\"atoms\":[137,140]}},{\"Repetition\":{\"atom\":136,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":149}},{\"Str\":{\"pattern\":\"-\"}},{\"Entity\":{\"atom\":148}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":146,\"min\":4,\"max\":4,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"second_year\",\"atom\":147}},{\"Sequence\":{\"atoms\":[144,145]}},{\"Entity\":{\"atom\":153}},{\"Str\":{\"pattern\":\":\"}},{\"Entity\":{\"atom\":148}},{\"Sequence\":{\"atoms\":[151,152]}},{\"Alternative\":{\"atoms\":[143,150]}},{\"Repetition\":{\"atom\":154,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[109,120,121,142,155]}},{\"Entity\":{\"atom\":168}},{\"Str\":{\"pattern\":\", \"}},{\"Entity\":{\"atom\":8}},{\"Repetition\":{\"atom\":159,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"edition_number\",\"atom\":160}},{\"Str\":{\"pattern\":\"st\"}},{\"Str\":{\"pattern\":\"nd\"}},{\"Str\":{\"pattern\":\"rd\"}},{\"Str\":{\"pattern\":\"th\"}},{\"Alternative\":{\"atoms\":[162,163,164,165]}},{\"Str\":{\"pattern\":\" edition\"}},{\"Sequence\":{\"atoms\":[158,161,166,167]}},{\"Repetition\":{\"atom\":157,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[106,107,108,169]}},{\"Entity\":{\"atom\":46}},{\"Entity\":{\"atom\":93}},{\"Entity\":{\"atom\":105}},{\"Alternative\":{\"atoms\":[0,171,172,173]}}],\"root\":174},\"bindings\":[{\"capture\":\"type\",\"path\":\"type\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_type\",\"path\":\"second_type\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"chapter\",\"path\":\"chapter\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"section\",\"path\":\"section\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"subsection\",\"path\":\"subsection\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"year\",\"path\":\"year\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_year\",\"path\":\"second_year\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"number\",\"path\":\"number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"part\",\"path\":\"part\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_number\",\"path\":\"second_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_part\",\"path\":\"second_part\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"part_number\",\"path\":\"part_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"second_part_number\",\"path\":\"second_part_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null},{\"capture\":\"edition_number\",\"path\":\"edition_number\",\"type\":\"string\",\"card\":null,\"preprocess\":null}]}},\"preprocess\":{},\"tables\":{},\"lint\":{\"order_warnings\":[\"rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)\"]},\"default_entry\":\"identifier\",\"render\":{},\"derive\":{},\"tests\":[{\"entry\":\"identifier\",\"kind\":\"accept\",\"input\":\"API RP 1632-1987\",\"expect\":{}},{\"entry\":\"identifier\",\"kind\":\"accept\",\"input\":\"API MPMS CH 11.1\",\"expect\":{}},{\"entry\":\"identifier\",\"kind\":\"accept\",\"input\":\"API SPEC 5DP/STD 5DP, 1st edition\",\"expect\":{}},{\"entry\":\"identifier\",\"kind\":\"reject\",\"input\":\"nonsense\",\"expect\":{}}],\"docs\":{},\"source\":\"# Port of lib/pubid/api/parser.rb: API MPMS/typed/typeless identifiers\\n# with slash-combined second identifiers. The API MPMP normalization\\n# stays binder-side.\\n#\\n# Edition-2 notes: the combined form drops its first/second wrapper\\n# captures (a wrapper over rule refs expands to element hashes, and the\\n# bindings cannot nest); the second identifier's fields capture under\\n# second_* names so they never collapse onto the first's, mirroring the\\n# csa part_* / iec supp_* position-scoped conventions.\\n\\ngrammar PubidApi version \\\"0.1.0\\\" edition 2 {\\n num_letter_char = %x30-39 / %x41-5A\\n doc_type = (\\\"MPMS\\\" / \\\"BULL\\\" / \\\"SPEC\\\" / \\\"STD\\\" / \\\"RP\\\" / \\\"TR\\\" / \\\"COS\\\" / \\\"PUBL\\\") as type\\n second_doc_type = (\\\"MPMS\\\" / \\\"BULL\\\" / \\\"SPEC\\\" / \\\"STD\\\" / \\\"RP\\\" / \\\"TR\\\" / \\\"COS\\\" / \\\"PUBL\\\") as second_type\\n chapter_notation = \\\" CH \\\" ( 1*digit ) as chapter\\n year = ( 4digit ) as year\\n second_year = ( 4digit ) as second_year\\n date_dash = \\\"-\\\" year\\n date_colon = \\\":\\\" year\\n second_date_dash = \\\"-\\\" second_year\\n second_date_colon = \\\":\\\" second_year\\n reaffirmation = \\\" (R\\\" year \\\")\\\"\\n part_notation = \\\", Part \\\" ( 1*digit ) as part_number\\n second_part_notation = \\\", Part \\\" ( 1*digit ) as second_part_number\\n number_with_part = {\\n (\\n ( 1*(%x30-39 / %x41-5A) ) as number\\n [ \\\"-\\\" ( 1*(%x30-39 / %x41-5A) ) as part ]\\n )\\n }\\n second_number_with_part = {\\n (\\n ( 1*(%x30-39 / %x41-5A) ) as second_number\\n [ \\\"-\\\" ( 1*(%x30-39 / %x41-5A) ) as second_part ]\\n )\\n }\\n mpms_identifier = {\\n \\\"API \\\" \\\"MPMS\\\" as type chapter_notation\\n [ ( \\\".\\\" ( 1*digit [*upper] ) as section ) ]\\n [ ( \\\".\\\" ( 1*digit [*upper] ) as subsection ) ]\\n [(date_dash / date_colon)]\\n }\\n typed_identifier = {\\n \\\"API \\\" doc_type \\\" \\\" number_with_part\\n [part_notation]\\n [(date_dash / date_colon)]\\n [reaffirmation]\\n }\\n typeless_identifier = {\\n \\\"API \\\" number_with_part\\n [part_notation]\\n [(date_dash / date_colon)]\\n [reaffirmation]\\n }\\n second_identifier = {\\n second_doc_type \\\" \\\" second_number_with_part\\n [second_part_notation]\\n [(second_date_dash / second_date_colon)]\\n }\\n edition_notation = \\\", \\\" ( 1*digit ) as edition_number (\\\"st\\\" / \\\"nd\\\" / \\\"rd\\\" / \\\"th\\\") \\\" edition\\\"\\n combined_identifier = {\\n ( mpms_identifier / typed_identifier / typeless_identifier )\\n \\\"/\\\"\\n second_identifier\\n [edition_notation]\\n }\\n identifier = combined_identifier / mpms_identifier / typed_identifier / typeless_identifier\\n upper = %x41-5A\\n digit = %x30-39\\n dash = \\\"-\\\"\\n slash = \\\"/\\\"\\n colon = \\\":\\\"\\n dot = \\\".\\\"\\n space = \\\" \\\"\\n entry identifier: identifier\\n\\n bindings identifier {\\n type -> type (string)\\n second_type -> second_type (string)\\n chapter -> chapter (string)\\n section -> section (string)\\n subsection -> subsection (string)\\n year -> year (string)\\n second_year -> second_year (string)\\n number -> number (string)\\n part -> part (string)\\n second_number -> second_number (string)\\n second_part -> second_part (string)\\n part_number -> part_number (string)\\n second_part_number -> second_part_number (string)\\n edition_number -> edition_number (string)\\n }\\n\\n test {\\n accept \\\"API RP 1632-1987\\\"\\n accept \\\"API MPMS CH 11.1\\\"\\n accept \\\"API SPEC 5DP/STD 5DP, 1st edition\\\"\\n reject \\\"nonsense\\\"\\n }\\n}\\n\",\"source_hash\":\"c4bda4490af8a22aeb81fa6f4dd00ec17d36f2b42d0bc418252c43406dcd28d8\",\"unicode_tables\":\"onigmo (Ruby 3.4.8)\",\"compiler_version\":\"1.5.1.0\",\"edition\":2,\"semantics_hash\":\"sha256:e3c89569389cdbfd0c02c924bfa0c02b76c36ea6165f0470b292890f08a1af77\",\"checksum\":\"sha256:3eb15d13b948e92933ec41f3efa19605701a615fe6490deecc655ce62df9fd66\",\"validated\":{\"lint_errors\":0,\"lint_warnings\":6,\"tests_total\":4,\"tests_failures\":0,\"self_test\":true}}";
|