@pubid/pubid 0.1.73 → 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.
- package/README.md +33 -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/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/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/README.md
CHANGED
|
@@ -309,6 +309,39 @@ walks the compiled import graphs (no `node:*` module, nothing beyond
|
|
|
309
309
|
`parsanol/browser`) and bundles every entry with
|
|
310
310
|
`esbuild --platform=neutral` and no node externals.
|
|
311
311
|
|
|
312
|
+
## Worker-safe parse: the artifact entries (relaton-api-js#188)
|
|
313
|
+
|
|
314
|
+
From 0.1.71, the node entry of each generated-substrate flavor
|
|
315
|
+
(`dist/flavors/<flavor>/index.js`) loads `dist/parg/runtime.js`, which
|
|
316
|
+
uses `node:fs`. These 24 flavors now ship a worker entry
|
|
317
|
+
`dist/flavors/<flavor>/worker.js` on the nist/ieee path:
|
|
318
|
+
|
|
319
|
+
api, ashrae, asme, astm, calconnect, cie, easc, ecma, etsi, gb, iala,
|
|
320
|
+
iana, idf, ietf, iho, jcgm, oasis, ogc, omg, plateau, sae, tgpp, w3c,
|
|
321
|
+
xsf
|
|
322
|
+
|
|
323
|
+
Each entry runs the same baked artifact as the node entry, over
|
|
324
|
+
`parsanol/browser`. It bundles only its own artifact
|
|
325
|
+
(`dist/parg/artifacts/<flavor>.js`, about 90 KB gzip for all 24). The
|
|
326
|
+
entries share one lazy wasm init for each isolate with the nist and
|
|
327
|
+
ieee entries. The factory is async, and `parse()` is synchronous:
|
|
328
|
+
|
|
329
|
+
```ts
|
|
330
|
+
import { ietfWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/ietf/worker.js";
|
|
331
|
+
import { ialaWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/iala/worker.js";
|
|
332
|
+
|
|
333
|
+
const ietf = await ietfWorkerGrammarImplementation(parsanolWasm);
|
|
334
|
+
const iala = await ialaWorkerGrammarImplementation(parsanolWasm);
|
|
335
|
+
|
|
336
|
+
ietf.parse("RFC 8446");
|
|
337
|
+
iala.parse("IALA G1045 Annex Ed 1");
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
The worker result is the node result: `test/worker-artifact-parity.test.ts`
|
|
341
|
+
parses every pinned corpus row through both entries and compares the
|
|
342
|
+
hashes. `workerForeignResolver()` still composes the synchronous
|
|
343
|
+
pure-TS ports of these flavors (`grammar.worker.ts`).
|
|
344
|
+
|
|
312
345
|
## Development
|
|
313
346
|
|
|
314
347
|
```sh
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the api 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 api
|
|
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 { apiWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/api/worker.js";
|
|
10
|
+
//! const api = await apiWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! api.parse("API BULL 1178");
|
|
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/api.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeApiGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function apiWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeApiGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the ashrae 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 ashrae
|
|
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 { ashraeWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/ashrae/worker.js";
|
|
10
|
+
//! const ashrae = await ashraeWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! ashrae.parse("ASHRAE Standard 140-2007");
|
|
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/ashrae.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeAshraeGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ashraeWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeAshraeGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the asme 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 asme
|
|
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 { asmeWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/asme/worker.js";
|
|
10
|
+
//! const asme = await asmeWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! asme.parse("ASME PTB-14-2009");
|
|
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/asme.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeAsmeGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function asmeWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeAsmeGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the astm 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 astm
|
|
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 { astmWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/astm/worker.js";
|
|
10
|
+
//! const astm = await astmWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! astm.parse("ADJF3504-EA");
|
|
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/astm.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeAstmGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function astmWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeAstmGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the calconnect 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 calconnect
|
|
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 { calconnectWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/calconnect/worker.js";
|
|
10
|
+
//! const calconnect = await calconnectWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! calconnect.parse("CC 11001:2024");
|
|
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/calconnect.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeCalconnectGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function calconnectWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeCalconnectGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the cie 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 cie
|
|
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 { cieWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/cie/worker.js";
|
|
10
|
+
//! const cie = await cieWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! cie.parse("CIE 198-SP1.1:2011");
|
|
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/cie.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeCieGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function cieWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeCieGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the easc 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 easc
|
|
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 { eascWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/easc/worker.js";
|
|
10
|
+
//! const easc = await eascWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! easc.parse("ПМГ 02-2008");
|
|
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/easc.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeEascGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function eascWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeEascGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the ecma 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 ecma
|
|
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 { ecmaWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/ecma/worker.js";
|
|
10
|
+
//! const ecma = await ecmaWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! ecma.parse("ECMA MEM/1962");
|
|
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/ecma.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeEcmaGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ecmaWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeEcmaGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the etsi 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 etsi
|
|
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 { etsiWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/etsi/worker.js";
|
|
10
|
+
//! const etsi = await etsiWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! etsi.parse("ETSI ETR 108/A1 ed.1 (1995-08)");
|
|
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/etsi.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeEtsiGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function etsiWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeEtsiGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the gb 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 gb
|
|
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 { gbWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/gb/worker.js";
|
|
10
|
+
//! const gb = await gbWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! gb.parse("GB/T 5606 (all parts)");
|
|
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/gb.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeGbGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function gbWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeGbGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the iala 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 iala
|
|
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 { ialaWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/iala/worker.js";
|
|
10
|
+
//! const iala = await ialaWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! iala.parse("IALA G1045 Annex Ed 1");
|
|
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/iala.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeIalaGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ialaWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeIalaGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the iana 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 iana
|
|
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 { ianaWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/iana/worker.js";
|
|
10
|
+
//! const iana = await ianaWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! iana.parse("IANA _6lowpan-parameters");
|
|
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/iana.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeIanaGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ianaWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeIanaGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the idf 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 idf
|
|
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 { idfWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/idf/worker.js";
|
|
10
|
+
//! const idf = await idfWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! idf.parse("IDF 140-1:2007/AMD 1:2012");
|
|
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/idf.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeIdfGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function idfWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeIdfGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the ietf 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 ietf
|
|
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 { ietfWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/ietf/worker.js";
|
|
10
|
+
//! const ietf = await ietfWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! ietf.parse("RFC 8446");
|
|
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/ietf.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeIetfGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ietfWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeIetfGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the iho 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 iho
|
|
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 { ihoWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/iho/worker.js";
|
|
10
|
+
//! const iho = await ihoWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! iho.parse("IHO B-1 1.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/iho.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeIhoGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function ihoWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeIhoGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//! The worker entry for the jcgm 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 jcgm
|
|
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 { jcgmWorkerGrammarImplementation } from "@pubid/pubid/dist/flavors/jcgm/worker.js";
|
|
10
|
+
//! const jcgm = await jcgmWorkerGrammarImplementation(wasmOrUrl);
|
|
11
|
+
//! jcgm.parse("JCGM 100:2008/Amd 1");
|
|
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/jcgm.js";
|
|
17
|
+
import { parseBoundWith, workerArtifactRuntime } from "../../parg/worker-engine.js";
|
|
18
|
+
import * as substrate from "./generated/substrate.js";
|
|
19
|
+
import { makeJcgmGrammarImplementation } from "./implementation.js";
|
|
20
|
+
export async function jcgmWorkerGrammarImplementation(wasm) {
|
|
21
|
+
const runtime = await workerArtifactRuntime(artifact, wasm, substrate.ENTRY);
|
|
22
|
+
return makeJcgmGrammarImplementation((body) => substrate.boundToWire(parseBoundWith(runtime, substrate.FLAVOR, body)));
|
|
23
|
+
}
|
|
@@ -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
|
+
}
|