@pubid/pubid 0.1.72 → 0.1.74

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.
Files changed (112) hide show
  1. package/README.md +55 -4
  2. package/artifact/corpus.json.gz +0 -0
  3. package/dist/flavors/api/worker.d.ts +3 -0
  4. package/dist/flavors/api/worker.js +23 -0
  5. package/dist/flavors/ashrae/worker.d.ts +3 -0
  6. package/dist/flavors/ashrae/worker.js +23 -0
  7. package/dist/flavors/asme/worker.d.ts +3 -0
  8. package/dist/flavors/asme/worker.js +23 -0
  9. package/dist/flavors/astm/worker.d.ts +3 -0
  10. package/dist/flavors/astm/worker.js +23 -0
  11. package/dist/flavors/calconnect/worker.d.ts +3 -0
  12. package/dist/flavors/calconnect/worker.js +23 -0
  13. package/dist/flavors/cie/worker.d.ts +3 -0
  14. package/dist/flavors/cie/worker.js +23 -0
  15. package/dist/flavors/easc/worker.d.ts +3 -0
  16. package/dist/flavors/easc/worker.js +23 -0
  17. package/dist/flavors/ecma/worker.d.ts +3 -0
  18. package/dist/flavors/ecma/worker.js +23 -0
  19. package/dist/flavors/etsi/worker.d.ts +3 -0
  20. package/dist/flavors/etsi/worker.js +23 -0
  21. package/dist/flavors/gb/worker.d.ts +3 -0
  22. package/dist/flavors/gb/worker.js +23 -0
  23. package/dist/flavors/iala/worker.d.ts +3 -0
  24. package/dist/flavors/iala/worker.js +23 -0
  25. package/dist/flavors/iana/worker.d.ts +3 -0
  26. package/dist/flavors/iana/worker.js +23 -0
  27. package/dist/flavors/idf/worker.d.ts +3 -0
  28. package/dist/flavors/idf/worker.js +23 -0
  29. package/dist/flavors/ieee/model.js +14 -4
  30. package/dist/flavors/ieee/preprocessor.js +1 -0
  31. package/dist/flavors/ietf/worker.d.ts +3 -0
  32. package/dist/flavors/ietf/worker.js +23 -0
  33. package/dist/flavors/iho/worker.d.ts +3 -0
  34. package/dist/flavors/iho/worker.js +23 -0
  35. package/dist/flavors/jcgm/worker.d.ts +3 -0
  36. package/dist/flavors/jcgm/worker.js +23 -0
  37. package/dist/flavors/oasis/worker.d.ts +3 -0
  38. package/dist/flavors/oasis/worker.js +23 -0
  39. package/dist/flavors/ogc/worker.d.ts +3 -0
  40. package/dist/flavors/ogc/worker.js +23 -0
  41. package/dist/flavors/omg/worker.d.ts +3 -0
  42. package/dist/flavors/omg/worker.js +23 -0
  43. package/dist/flavors/plateau/worker.d.ts +3 -0
  44. package/dist/flavors/plateau/worker.js +23 -0
  45. package/dist/flavors/sae/worker.d.ts +3 -0
  46. package/dist/flavors/sae/worker.js +23 -0
  47. package/dist/flavors/tgpp/worker.d.ts +3 -0
  48. package/dist/flavors/tgpp/worker.js +23 -0
  49. package/dist/flavors/w3c/worker.d.ts +3 -0
  50. package/dist/flavors/w3c/worker.js +23 -0
  51. package/dist/flavors/xsf/worker.d.ts +3 -0
  52. package/dist/flavors/xsf/worker.js +23 -0
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.js +1 -1
  55. package/dist/lane-keys.d.ts +68 -0
  56. package/dist/lane-keys.js +113 -0
  57. package/dist/model/identifier.js +5 -4
  58. package/dist/parg/artifacts/api.d.ts +2 -0
  59. package/dist/parg/artifacts/api.js +5 -0
  60. package/dist/parg/artifacts/ashrae.d.ts +2 -0
  61. package/dist/parg/artifacts/ashrae.js +5 -0
  62. package/dist/parg/artifacts/asme.d.ts +2 -0
  63. package/dist/parg/artifacts/asme.js +5 -0
  64. package/dist/parg/artifacts/astm.d.ts +2 -0
  65. package/dist/parg/artifacts/astm.js +5 -0
  66. package/dist/parg/artifacts/calconnect.d.ts +2 -0
  67. package/dist/parg/artifacts/calconnect.js +5 -0
  68. package/dist/parg/artifacts/cie.d.ts +2 -0
  69. package/dist/parg/artifacts/cie.js +5 -0
  70. package/dist/parg/artifacts/easc.d.ts +2 -0
  71. package/dist/parg/artifacts/easc.js +5 -0
  72. package/dist/parg/artifacts/ecma.d.ts +2 -0
  73. package/dist/parg/artifacts/ecma.js +5 -0
  74. package/dist/parg/artifacts/etsi.d.ts +2 -0
  75. package/dist/parg/artifacts/etsi.js +5 -0
  76. package/dist/parg/artifacts/gb.d.ts +2 -0
  77. package/dist/parg/artifacts/gb.js +5 -0
  78. package/dist/parg/artifacts/iala.d.ts +2 -0
  79. package/dist/parg/artifacts/iala.js +5 -0
  80. package/dist/parg/artifacts/iana.d.ts +2 -0
  81. package/dist/parg/artifacts/iana.js +5 -0
  82. package/dist/parg/artifacts/idf.d.ts +2 -0
  83. package/dist/parg/artifacts/idf.js +5 -0
  84. package/dist/parg/artifacts/ietf.d.ts +2 -0
  85. package/dist/parg/artifacts/ietf.js +5 -0
  86. package/dist/parg/artifacts/iho.d.ts +2 -0
  87. package/dist/parg/artifacts/iho.js +5 -0
  88. package/dist/parg/artifacts/jcgm.d.ts +2 -0
  89. package/dist/parg/artifacts/jcgm.js +5 -0
  90. package/dist/parg/artifacts/oasis.d.ts +2 -0
  91. package/dist/parg/artifacts/oasis.js +5 -0
  92. package/dist/parg/artifacts/ogc.d.ts +2 -0
  93. package/dist/parg/artifacts/ogc.js +5 -0
  94. package/dist/parg/artifacts/omg.d.ts +2 -0
  95. package/dist/parg/artifacts/omg.js +5 -0
  96. package/dist/parg/artifacts/plateau.d.ts +2 -0
  97. package/dist/parg/artifacts/plateau.js +5 -0
  98. package/dist/parg/artifacts/sae.d.ts +2 -0
  99. package/dist/parg/artifacts/sae.js +5 -0
  100. package/dist/parg/artifacts/tgpp.d.ts +2 -0
  101. package/dist/parg/artifacts/tgpp.js +5 -0
  102. package/dist/parg/artifacts/w3c.d.ts +2 -0
  103. package/dist/parg/artifacts/w3c.js +5 -0
  104. package/dist/parg/artifacts/xsf.d.ts +2 -0
  105. package/dist/parg/artifacts/xsf.js +5 -0
  106. package/dist/parg/worker-engine.d.ts +12 -0
  107. package/dist/parg/worker-engine.js +32 -0
  108. package/dist/parg/worker.d.ts +3 -5
  109. package/dist/parg/worker.js +3 -9
  110. package/dist/parse-surface.d.ts +3 -31
  111. package/dist/parse-surface.js +2 -67
  112. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function oasisWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function ogcWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function omgWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function plateauWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function saeWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function tgppWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function w3cWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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,3 @@
1
+ import type { FlavorImplementation } from "../../conformance/implementation.js";
2
+ import { type WorkerWasmInput } from "../../parg/worker-engine.js";
3
+ export declare function xsfWorkerGrammarImplementation(wasm?: WorkerWasmInput): Promise<FlavorImplementation>;
@@ -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
+ }
package/dist/index.d.ts CHANGED
@@ -8,6 +8,6 @@ export { checkCase, runFlavor, runCorpus } from "./conformance/runner.js";
8
8
  export { corpusModeImplementation, CorpusBackedIdentifier } from "./implementations/corpus-mode.js";
9
9
  export { grammarImplementation } from "./flavors/index.js";
10
10
  export { subsetMatch, valueMatch, exactMatch } from "./model/subset-match.js";
11
- export { parse, parseOk, render, laneKeys, norm, undatedNorm, allPartsNorm, ParseError, } from "./parse-surface.js";
12
- export type { ParseResult, LaneKeys } from "./parse-surface.js";
11
+ export { parse, parseOk, render, laneKeys, norm, undatedNorm, allPartsNorm, structuralPart, laneKeysFrom, laneKeysOf, ParseError, } from "./parse-surface.js";
12
+ export type { ParseResult, LaneKeys, LaneKeySource } from "./parse-surface.js";
13
13
  export * as PubidUrn from "./pubid-urn/index.js";
package/dist/index.js CHANGED
@@ -10,6 +10,6 @@ export { grammarImplementation } from "./flavors/index.js";
10
10
  export { subsetMatch, valueMatch, exactMatch } from "./model/subset-match.js";
11
11
  // The parse surface: structured components, canonical render, the lane
12
12
  // keys and the parse_ok verdict (pubid/pubid-ts#226).
13
- export { parse, parseOk, render, laneKeys, norm, undatedNorm, allPartsNorm, ParseError, } from "./parse-surface.js";
13
+ export { parse, parseOk, render, laneKeys, norm, undatedNorm, allPartsNorm, structuralPart, laneKeysFrom, laneKeysOf, ParseError, } from "./parse-surface.js";
14
14
  // The pubid-scheme URN codec and the slug form (pubid-ts#161).
15
15
  export * as PubidUrn from "./pubid-urn/index.js";
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The lane keys (relaton/relaton-api-js#188): the `dated` / `undated` /
3
+ * `all_parts` normalized keys that the corpus lanes and the consumers
4
+ * index by. This module imports nothing, so a Cloudflare worker (no
5
+ * `nodejs_compat`) can import `@pubid/pubid/dist/lane-keys.js` and derive
6
+ * the keys from any identifier that a worker flavor entry returns.
7
+ *
8
+ * `norm` uppercases the canonical render and deletes spaces; `undated`
9
+ * strips every colon-year not followed by a dash; `all_parts`
10
+ * additionally strips the parsed part (with its subpart) — structurally,
11
+ * never by guessing: a trailing "-05" that pubid did not parse as a part
12
+ * is a date day, not a part, and stays.
13
+ */
14
+ /** The lane keys of one identifier: the lookup lanes the corpus and the
15
+ * consumers index by. */
16
+ export interface LaneKeys {
17
+ /** The dated lane: the normalized canonical (uppercased, de-spaced). */
18
+ dated: string;
19
+ /** The undated lane: every colon-year not followed by a dash is gone
20
+ * (base and supplement alike — one rule, no per-flavor casing). */
21
+ undated: string;
22
+ /** The all-parts lane: the parsed part (and subpart) stripped from the
23
+ * undated lane. Structural only — an unparsed trailing "-N" is never a
24
+ * part. */
25
+ all_parts: string;
26
+ }
27
+ /** The surface of a parsed identifier that the lane keys read. */
28
+ export interface LaneKeySource {
29
+ /** The canonical human render. */
30
+ toHuman(): string;
31
+ /** The canonical component record (the wire shape). */
32
+ toHash(): Record<string, unknown>;
33
+ }
34
+ /**
35
+ * The dated lane: the canonical render uppercased and de-spaced. Ruby's
36
+ * `canonical.upcase.delete(" ")` — exactly the space character is
37
+ * deleted, not every whitespace run.
38
+ */
39
+ export declare function norm(canonical: string): string;
40
+ /**
41
+ * The undated lane from a norm key: every `:?`-year not followed by a
42
+ * dash is stripped — globally, base and supplement years alike. Ruby's
43
+ * `gsub(/:?(?:19|20)\d{2}(?=[^-]*$)/, "")` verbatim.
44
+ */
45
+ export declare function undatedNorm(normKey: string): string;
46
+ /**
47
+ * The all-parts lane from an undated key: the first `-<part>-<subpart>`
48
+ * (when a subpart is given), else the first `-<part>`, that is not
49
+ * followed by a dash is stripped. A segment that ends in a digit never
50
+ * continues into a digit, so part `1` does not match the start of `-10`;
51
+ * a letter suffix that norm glued on (`ED1`, `RLV`) does not block the
52
+ * strip. A blank part strips nothing.
53
+ */
54
+ export declare function allPartsNorm(undated: string, part?: string, subpart?: string): string;
55
+ /**
56
+ * The structural part of a canonical component record: the identifier's
57
+ * own `part` facet, else the base's (Ruby's `id.part || id.base&.part`).
58
+ * A part facet is either a string or a typed record carrying `value`
59
+ * (the NIST lettered parts); anything else is no part.
60
+ */
61
+ export declare function structuralPart(components: Record<string, unknown>): string | undefined;
62
+ /** The lane keys for an already-canonical record: norm from the render,
63
+ * undated from the norm, all_parts from the parsed part and subpart. */
64
+ export declare function laneKeysFrom(canonical: string, components: Record<string, unknown>): LaneKeys;
65
+ /** The lane keys of a parsed identifier: `laneKeysFrom(id.toHuman(),
66
+ * id.toHash())`. Use it on the identifier that a worker flavor entry
67
+ * (`dist/flavors/<flavor>/worker.js`) returns. */
68
+ export declare function laneKeysOf(identifier: LaneKeySource): LaneKeys;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * The lane keys (relaton/relaton-api-js#188): the `dated` / `undated` /
3
+ * `all_parts` normalized keys that the corpus lanes and the consumers
4
+ * index by. This module imports nothing, so a Cloudflare worker (no
5
+ * `nodejs_compat`) can import `@pubid/pubid/dist/lane-keys.js` and derive
6
+ * the keys from any identifier that a worker flavor entry returns.
7
+ *
8
+ * `norm` uppercases the canonical render and deletes spaces; `undated`
9
+ * strips every colon-year not followed by a dash; `all_parts`
10
+ * additionally strips the parsed part (with its subpart) — structurally,
11
+ * never by guessing: a trailing "-05" that pubid did not parse as a part
12
+ * is a date day, not a part, and stays.
13
+ */
14
+ /** Ruby Regexp.escape, for the all-parts strip of an arbitrary part. */
15
+ function escapeRegExp(text) {
16
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
17
+ }
18
+ /**
19
+ * The dated lane: the canonical render uppercased and de-spaced. Ruby's
20
+ * `canonical.upcase.delete(" ")` — exactly the space character is
21
+ * deleted, not every whitespace run.
22
+ */
23
+ export function norm(canonical) {
24
+ return canonical.toUpperCase().replaceAll(" ", "");
25
+ }
26
+ /**
27
+ * The undated lane from a norm key: every `:?`-year not followed by a
28
+ * dash is stripped — globally, base and supplement years alike. Ruby's
29
+ * `gsub(/:?(?:19|20)\d{2}(?=[^-]*$)/, "")` verbatim.
30
+ */
31
+ export function undatedNorm(normKey) {
32
+ return normKey.replace(/:?(?:19|20)\d{2}(?=[^-]*$)/g, "");
33
+ }
34
+ function stripTrailingSegment(undated, segment) {
35
+ const digitBoundary = /[0-9]$/.test(segment) ? "(?![0-9])" : "";
36
+ const pattern = new RegExp(`-${escapeRegExp(segment.toUpperCase())}${digitBoundary}(?=[^-]*$)`);
37
+ return pattern.test(undated) ? undated.replace(pattern, "") : undefined;
38
+ }
39
+ /**
40
+ * The all-parts lane from an undated key: the first `-<part>-<subpart>`
41
+ * (when a subpart is given), else the first `-<part>`, that is not
42
+ * followed by a dash is stripped. A segment that ends in a digit never
43
+ * continues into a digit, so part `1` does not match the start of `-10`;
44
+ * a letter suffix that norm glued on (`ED1`, `RLV`) does not block the
45
+ * strip. A blank part strips nothing.
46
+ */
47
+ export function allPartsNorm(undated, part, subpart) {
48
+ if (part === undefined || part === "")
49
+ return undated;
50
+ if (subpart !== undefined && subpart !== "") {
51
+ const stripped = stripTrailingSegment(undated, `${part}-${subpart}`);
52
+ if (stripped !== undefined)
53
+ return stripped;
54
+ }
55
+ return stripTrailingSegment(undated, part) ?? undated;
56
+ }
57
+ function facetText(raw) {
58
+ if (typeof raw === "string")
59
+ return raw;
60
+ if (raw !== undefined && raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
61
+ const value = raw["value"];
62
+ if (typeof value === "string")
63
+ return value;
64
+ if (typeof value === "number")
65
+ return String(value);
66
+ }
67
+ return undefined;
68
+ }
69
+ function isPresent(value) {
70
+ return value !== undefined && value !== null;
71
+ }
72
+ /** The component record that carries the structural part: the
73
+ * identifier's own, else its base's. */
74
+ function partRecord(components) {
75
+ if (isPresent(components["part"]))
76
+ return components;
77
+ const base = components["base"];
78
+ if (isPresent(base) && typeof base === "object" && !Array.isArray(base)) {
79
+ return base;
80
+ }
81
+ return undefined;
82
+ }
83
+ /**
84
+ * The structural part of a canonical component record: the identifier's
85
+ * own `part` facet, else the base's (Ruby's `id.part || id.base&.part`).
86
+ * A part facet is either a string or a typed record carrying `value`
87
+ * (the NIST lettered parts); anything else is no part.
88
+ */
89
+ export function structuralPart(components) {
90
+ const record = partRecord(components);
91
+ return record === undefined ? undefined : facetText(record["part"]);
92
+ }
93
+ function structuralSubpart(components) {
94
+ const record = partRecord(components);
95
+ return record === undefined ? undefined : facetText(record["subpart"]);
96
+ }
97
+ /** The lane keys for an already-canonical record: norm from the render,
98
+ * undated from the norm, all_parts from the parsed part and subpart. */
99
+ export function laneKeysFrom(canonical, components) {
100
+ const dated = norm(canonical);
101
+ const undated = undatedNorm(dated);
102
+ return {
103
+ dated,
104
+ undated,
105
+ all_parts: allPartsNorm(undated, structuralPart(components), structuralSubpart(components)),
106
+ };
107
+ }
108
+ /** The lane keys of a parsed identifier: `laneKeysFrom(id.toHuman(),
109
+ * id.toHash())`. Use it on the identifier that a worker flavor entry
110
+ * (`dist/flavors/<flavor>/worker.js`) returns. */
111
+ export function laneKeysOf(identifier) {
112
+ return laneKeysFrom(identifier.toHuman(), identifier.toHash());
113
+ }
@@ -186,10 +186,11 @@ export class BaseIdentifier {
186
186
  /** Serialize one attribute's value (component → toWire, nested identifier → toHash, scalars as-is). */
187
187
  serializeValue(value) {
188
188
  // A nested identifier serializes through the NESTED mapping list: a
189
- // class whose top-level wire deletes derived keys (the Ruby reference
190
- // drops JointDevelopment's derived publisher/copublisher only on the
191
- // public to_hash — lutaml's nested transform reads the accessors and
192
- // keeps them) must keep them here.
189
+ // flavor class declares which derived keys drop on which path. Since
190
+ // the reference's nested-safe compact_hash twins (gem#806), the
191
+ // JointDevelopment/DualPublished/AdoptedStandard deletes apply on the
192
+ // nested path too (their mappingsNested filters); classes without a
193
+ // twin keep the derived keys here.
193
194
  if (value instanceof BaseIdentifier)
194
195
  return value.toHashNested();
195
196
  if (value instanceof Component)
@@ -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}}";