@pubid/pubid 0.1.40 → 0.1.42
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 +25 -0
- package/dist/flavors/calconnect_pfs/index.d.ts +51 -0
- package/dist/flavors/calconnect_pfs/index.js +118 -0
- package/dist/flavors/etsi_pfs/index.d.ts +100 -0
- package/dist/flavors/etsi_pfs/index.js +265 -0
- package/dist/flavors/index.js +6 -0
- package/dist/flavors/register-types.d.ts +76 -0
- package/dist/flavors/register-types.js +78 -0
- package/dist/pubid-urn/schemas/calconnect_pfs.d.ts +8 -0
- package/dist/pubid-urn/schemas/calconnect_pfs.js +16 -0
- package/dist/pubid-urn/schemas/etsi_pfs.d.ts +8 -0
- package/dist/pubid-urn/schemas/etsi_pfs.js +20 -0
- package/dist/pubid-urn/schemas/index.d.ts +1 -1
- package/dist/pubid-urn/schemas/index.js +5 -1
- package/dist/register-types.d.ts +23 -0
- package/dist/register-types.js +23 -0
- package/package.json +1 -1
- package/vendor/parg/cen_pfs.json +1 -1
- package/vendor/parg/etsi_pfs.json +1 -1
- package/vendor/parg/iso.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identifier-type registration manifest (pubid/pubid-ts#169): the
|
|
3
|
+
* parg-free subset of the flavor graph, as side-effect imports only.
|
|
4
|
+
*
|
|
5
|
+
* Every flavor registers its model classes into the global type
|
|
6
|
+
* registry ({@linkcode import("../model/identifier.js").registerType},
|
|
7
|
+
* the *_TYPE_MAP role) from exactly one of its modules: the model
|
|
8
|
+
* module when the flavor has one, the implementation entry otherwise.
|
|
9
|
+
* The grammar barrel (`./index.js`) reaches the same modules
|
|
10
|
+
* transitively — but it also statically imports the nist, ieee and
|
|
11
|
+
* doi_pfs implementations, which pull `../parg/runtime.js`, whose
|
|
12
|
+
* module scope walks up to a package.json through node:fs. That is
|
|
13
|
+
* impossible in a worker bundle, so a worker cannot import the barrel
|
|
14
|
+
* to populate the registry.
|
|
15
|
+
*
|
|
16
|
+
* This manifest imports the registration modules DIRECTLY, bypassing
|
|
17
|
+
* every parg-tainted path:
|
|
18
|
+
*
|
|
19
|
+
* - model-registrant flavors: `<flavor>/model.js` — pure model
|
|
20
|
+
* declarations, no grammar wiring. (cen_cenelec, csa, gost, bsi and
|
|
21
|
+
* oiml entry modules import the barrel for co-publisher routing, so
|
|
22
|
+
* their model module is the only clean registration path.)
|
|
23
|
+
* - index-registrant flavors: `<flavor>/index.js` — the class lives on
|
|
24
|
+
* the implementation entry; none of these statically reaches the
|
|
25
|
+
* parg runtime (the conformance gate is
|
|
26
|
+
* test/register-types.test.ts's import-graph walk).
|
|
27
|
+
*
|
|
28
|
+
* doi_pfs registers nothing by design ("one scheme, one `_type`, one
|
|
29
|
+
* global resolution" — its canonical tag routes to the coded doi
|
|
30
|
+
* class), so it has no entry here.
|
|
31
|
+
*
|
|
32
|
+
* The worker entry is dist/register-types.js (src/register-types.ts):
|
|
33
|
+
* one import registers every flavor and exposes the pubid-scheme URN
|
|
34
|
+
* codec with no node-only module in the graph.
|
|
35
|
+
*/
|
|
36
|
+
import "./amca/model.js";
|
|
37
|
+
import "./api/model.js";
|
|
38
|
+
import "./ashrae/model.js";
|
|
39
|
+
import "./asme/model.js";
|
|
40
|
+
import "./astm/model.js";
|
|
41
|
+
import "./bsi/model.js";
|
|
42
|
+
import "./cen_cenelec/model.js";
|
|
43
|
+
import "./cie/model.js";
|
|
44
|
+
import "./csa/model.js";
|
|
45
|
+
import "./evs/model.js";
|
|
46
|
+
import "./gost/model.js";
|
|
47
|
+
import "./idf/model.js";
|
|
48
|
+
import "./iec/model.js";
|
|
49
|
+
import "./ieee/model.js";
|
|
50
|
+
import "./iso/model.js";
|
|
51
|
+
import "./itu/model.js";
|
|
52
|
+
import "./nist/model.js";
|
|
53
|
+
import "./oiml/model.js";
|
|
54
|
+
import "./ansi/index.js";
|
|
55
|
+
import "./bipm/index.js";
|
|
56
|
+
import "./calconnect/index.js";
|
|
57
|
+
import "./doi/index.js";
|
|
58
|
+
import "./easc/index.js";
|
|
59
|
+
import "./ecma/index.js";
|
|
60
|
+
import "./etsi/index.js";
|
|
61
|
+
import "./gb/index.js";
|
|
62
|
+
import "./iala/index.js";
|
|
63
|
+
import "./iana/index.js";
|
|
64
|
+
import "./ietf/index.js";
|
|
65
|
+
import "./iho/index.js";
|
|
66
|
+
import "./isbn/index.js";
|
|
67
|
+
import "./jcgm/index.js";
|
|
68
|
+
import "./jis/index.js";
|
|
69
|
+
import "./ogc/index.js";
|
|
70
|
+
import "./oasis/index.js";
|
|
71
|
+
import "./omg/index.js";
|
|
72
|
+
import "./plateau/index.js";
|
|
73
|
+
import "./tgpp/index.js";
|
|
74
|
+
import "./un/index.js";
|
|
75
|
+
import "./w3c/index.js";
|
|
76
|
+
import "./xsf/index.js";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identifier-type registration manifest (pubid/pubid-ts#169): the
|
|
3
|
+
* parg-free subset of the flavor graph, as side-effect imports only.
|
|
4
|
+
*
|
|
5
|
+
* Every flavor registers its model classes into the global type
|
|
6
|
+
* registry ({@linkcode import("../model/identifier.js").registerType},
|
|
7
|
+
* the *_TYPE_MAP role) from exactly one of its modules: the model
|
|
8
|
+
* module when the flavor has one, the implementation entry otherwise.
|
|
9
|
+
* The grammar barrel (`./index.js`) reaches the same modules
|
|
10
|
+
* transitively — but it also statically imports the nist, ieee and
|
|
11
|
+
* doi_pfs implementations, which pull `../parg/runtime.js`, whose
|
|
12
|
+
* module scope walks up to a package.json through node:fs. That is
|
|
13
|
+
* impossible in a worker bundle, so a worker cannot import the barrel
|
|
14
|
+
* to populate the registry.
|
|
15
|
+
*
|
|
16
|
+
* This manifest imports the registration modules DIRECTLY, bypassing
|
|
17
|
+
* every parg-tainted path:
|
|
18
|
+
*
|
|
19
|
+
* - model-registrant flavors: `<flavor>/model.js` — pure model
|
|
20
|
+
* declarations, no grammar wiring. (cen_cenelec, csa, gost, bsi and
|
|
21
|
+
* oiml entry modules import the barrel for co-publisher routing, so
|
|
22
|
+
* their model module is the only clean registration path.)
|
|
23
|
+
* - index-registrant flavors: `<flavor>/index.js` — the class lives on
|
|
24
|
+
* the implementation entry; none of these statically reaches the
|
|
25
|
+
* parg runtime (the conformance gate is
|
|
26
|
+
* test/register-types.test.ts's import-graph walk).
|
|
27
|
+
*
|
|
28
|
+
* doi_pfs registers nothing by design ("one scheme, one `_type`, one
|
|
29
|
+
* global resolution" — its canonical tag routes to the coded doi
|
|
30
|
+
* class), so it has no entry here.
|
|
31
|
+
*
|
|
32
|
+
* The worker entry is dist/register-types.js (src/register-types.ts):
|
|
33
|
+
* one import registers every flavor and exposes the pubid-scheme URN
|
|
34
|
+
* codec with no node-only module in the graph.
|
|
35
|
+
*/
|
|
36
|
+
// Model-registrant flavors: registration lives in <flavor>/model.js.
|
|
37
|
+
import "./amca/model.js";
|
|
38
|
+
import "./api/model.js";
|
|
39
|
+
import "./ashrae/model.js";
|
|
40
|
+
import "./asme/model.js";
|
|
41
|
+
import "./astm/model.js";
|
|
42
|
+
import "./bsi/model.js";
|
|
43
|
+
import "./cen_cenelec/model.js";
|
|
44
|
+
import "./cie/model.js";
|
|
45
|
+
import "./csa/model.js";
|
|
46
|
+
import "./evs/model.js";
|
|
47
|
+
import "./gost/model.js";
|
|
48
|
+
import "./idf/model.js";
|
|
49
|
+
import "./iec/model.js";
|
|
50
|
+
import "./ieee/model.js";
|
|
51
|
+
import "./iso/model.js";
|
|
52
|
+
import "./itu/model.js";
|
|
53
|
+
import "./nist/model.js";
|
|
54
|
+
import "./oiml/model.js";
|
|
55
|
+
// Index-registrant flavors: registration lives in <flavor>/index.js.
|
|
56
|
+
import "./ansi/index.js";
|
|
57
|
+
import "./bipm/index.js";
|
|
58
|
+
import "./calconnect/index.js";
|
|
59
|
+
import "./doi/index.js";
|
|
60
|
+
import "./easc/index.js";
|
|
61
|
+
import "./ecma/index.js";
|
|
62
|
+
import "./etsi/index.js";
|
|
63
|
+
import "./gb/index.js";
|
|
64
|
+
import "./iala/index.js";
|
|
65
|
+
import "./iana/index.js";
|
|
66
|
+
import "./ietf/index.js";
|
|
67
|
+
import "./iho/index.js";
|
|
68
|
+
import "./isbn/index.js";
|
|
69
|
+
import "./jcgm/index.js";
|
|
70
|
+
import "./jis/index.js";
|
|
71
|
+
import "./ogc/index.js";
|
|
72
|
+
import "./oasis/index.js";
|
|
73
|
+
import "./omg/index.js";
|
|
74
|
+
import "./plateau/index.js";
|
|
75
|
+
import "./tgpp/index.js";
|
|
76
|
+
import "./un/index.js";
|
|
77
|
+
import "./w3c/index.js";
|
|
78
|
+
import "./xsf/index.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pubid-scheme URN schema of CALCONNECT_PFS — the transcription
|
|
3
|
+
* of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
|
|
4
|
+
* #670; design in docs/URN-SCHEMES.adoc). GENERATED by
|
|
5
|
+
* scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
|
|
6
|
+
* schema and regenerate, never this table by hand.
|
|
7
|
+
*/
|
|
8
|
+
export declare const calconnectPfsSchema: import("../schema.js").FlavorSchema;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pubid-scheme URN schema of CALCONNECT_PFS — the transcription
|
|
3
|
+
* of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
|
|
4
|
+
* #670; design in docs/URN-SCHEMES.adoc). GENERATED by
|
|
5
|
+
* scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
|
|
6
|
+
* schema and regenerate, never this table by hand.
|
|
7
|
+
*/
|
|
8
|
+
import { define } from "../index.js";
|
|
9
|
+
export const calconnectPfsSchema = define("calconnect_pfs", (s) => {
|
|
10
|
+
s.atom("series", "series");
|
|
11
|
+
s.atom("year", "year");
|
|
12
|
+
s.atom("month", "month");
|
|
13
|
+
s.atom("day", "day");
|
|
14
|
+
s.type("pubid:calconnect:identifier", "id", { core: [] });
|
|
15
|
+
s.type("pubid:calconnect:standard", "std");
|
|
16
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pubid-scheme URN schema of ETSI_PFS — the transcription
|
|
3
|
+
* of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
|
|
4
|
+
* #670; design in docs/URN-SCHEMES.adoc). GENERATED by
|
|
5
|
+
* scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
|
|
6
|
+
* schema and regenerate, never this table by hand.
|
|
7
|
+
*/
|
|
8
|
+
export declare const etsiPfsSchema: import("../schema.js").FlavorSchema;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pubid-scheme URN schema of ETSI_PFS — the transcription
|
|
3
|
+
* of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
|
|
4
|
+
* #670; design in docs/URN-SCHEMES.adoc). GENERATED by
|
|
5
|
+
* scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
|
|
6
|
+
* schema and regenerate, never this table by hand.
|
|
7
|
+
*/
|
|
8
|
+
import { define } from "../index.js";
|
|
9
|
+
export const etsiPfsSchema = define("etsi_pfs", (s) => {
|
|
10
|
+
s.atom("type", "type");
|
|
11
|
+
s.atom("parts", "part");
|
|
12
|
+
s.atom("minor", "minor");
|
|
13
|
+
s.atom("year", "year");
|
|
14
|
+
s.atom("month", "month");
|
|
15
|
+
s.atom("version", "v");
|
|
16
|
+
s.type("pubid:etsi:etsi-standard", "es", { core: [] });
|
|
17
|
+
s.type("pubid:etsi:amendment", "amd", { core: [["number", "int"]] });
|
|
18
|
+
s.type("pubid:etsi:corrigendum", "cor", { core: [["number", "int"]] });
|
|
19
|
+
s.type("pubid:etsi:identifier", "id", { core: [] });
|
|
20
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The registry of all
|
|
2
|
+
* The registry of all 47 flavor pubid-urn schema tables — the TS mirror
|
|
3
3
|
* of lib/pubid.rb's autoloaded Pubid::<Flavor>::PubidUrnSchema chain.
|
|
4
4
|
* Declared tables only: importing this module has no side effects; the
|
|
5
5
|
* pubid-urn module builds its flavor lookup lazily from this array.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The registry of all
|
|
2
|
+
* The registry of all 47 flavor pubid-urn schema tables — the TS mirror
|
|
3
3
|
* of lib/pubid.rb's autoloaded Pubid::<Flavor>::PubidUrnSchema chain.
|
|
4
4
|
* Declared tables only: importing this module has no side effects; the
|
|
5
5
|
* pubid-urn module builds its flavor lookup lazily from this array.
|
|
@@ -14,6 +14,7 @@ import { astmSchema } from "./astm.js";
|
|
|
14
14
|
import { bipmSchema } from "./bipm.js";
|
|
15
15
|
import { bsiSchema } from "./bsi.js";
|
|
16
16
|
import { calconnectSchema } from "./calconnect.js";
|
|
17
|
+
import { calconnectPfsSchema } from "./calconnect_pfs.js";
|
|
17
18
|
import { ccsdsSchema } from "./ccsds.js";
|
|
18
19
|
import { cencenelecSchema } from "./cencenelec.js";
|
|
19
20
|
import { cieSchema } from "./cie.js";
|
|
@@ -23,6 +24,7 @@ import { doiPfsSchema } from "./doi_pfs.js";
|
|
|
23
24
|
import { eascSchema } from "./easc.js";
|
|
24
25
|
import { ecmaSchema } from "./ecma.js";
|
|
25
26
|
import { etsiSchema } from "./etsi.js";
|
|
27
|
+
import { etsiPfsSchema } from "./etsi_pfs.js";
|
|
26
28
|
import { evsSchema } from "./evs.js";
|
|
27
29
|
import { gbSchema } from "./gb.js";
|
|
28
30
|
import { gostSchema } from "./gost.js";
|
|
@@ -61,6 +63,7 @@ export const PUBID_URN_SCHEMAS = [
|
|
|
61
63
|
bipmSchema,
|
|
62
64
|
bsiSchema,
|
|
63
65
|
calconnectSchema,
|
|
66
|
+
calconnectPfsSchema,
|
|
64
67
|
ccsdsSchema,
|
|
65
68
|
cencenelecSchema,
|
|
66
69
|
cieSchema,
|
|
@@ -70,6 +73,7 @@ export const PUBID_URN_SCHEMAS = [
|
|
|
70
73
|
eascSchema,
|
|
71
74
|
ecmaSchema,
|
|
72
75
|
etsiSchema,
|
|
76
|
+
etsiPfsSchema,
|
|
73
77
|
evsSchema,
|
|
74
78
|
gbSchema,
|
|
75
79
|
gostSchema,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The worker-safe entry (pubid/pubid-ts#169): one import registers
|
|
3
|
+
* every flavor's identifier types and exposes the pubid-scheme URN
|
|
4
|
+
* codec — with no node-only module in the import graph.
|
|
5
|
+
*
|
|
6
|
+
* `dist/pubid-urn/index.js` alone decodes nothing on a worker ("unknown
|
|
7
|
+
* identifier type …"), because the type registry lives in
|
|
8
|
+
* {@linkcode import("./model/identifier.js").resolveType} and is
|
|
9
|
+
* populated by importing flavor modules; every existing path to those
|
|
10
|
+
* modules (the grammar barrel `dist/flavors/index.js`, or the root
|
|
11
|
+
* `dist/index.js`) drags `dist/parg/runtime.js`, whose module scope
|
|
12
|
+
* walks up to a package.json through node:fs — impossible in a worker
|
|
13
|
+
* bundle. This entry composes the parg-free registration manifest
|
|
14
|
+
* (./flavors/register-types.js) with the codec, so
|
|
15
|
+
*
|
|
16
|
+
* import { PubidUrn } from "@pubid/pubid/register-types.js";
|
|
17
|
+
*
|
|
18
|
+
* covers every flavor in a worker. The grammar-backed
|
|
19
|
+
* `grammarImplementation` (open-ended parse routing) deliberately stays
|
|
20
|
+
* behind the node-only barrel: it cannot load in a worker today.
|
|
21
|
+
*/
|
|
22
|
+
import "./flavors/register-types.js";
|
|
23
|
+
export * as PubidUrn from "./pubid-urn/index.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The worker-safe entry (pubid/pubid-ts#169): one import registers
|
|
3
|
+
* every flavor's identifier types and exposes the pubid-scheme URN
|
|
4
|
+
* codec — with no node-only module in the import graph.
|
|
5
|
+
*
|
|
6
|
+
* `dist/pubid-urn/index.js` alone decodes nothing on a worker ("unknown
|
|
7
|
+
* identifier type …"), because the type registry lives in
|
|
8
|
+
* {@linkcode import("./model/identifier.js").resolveType} and is
|
|
9
|
+
* populated by importing flavor modules; every existing path to those
|
|
10
|
+
* modules (the grammar barrel `dist/flavors/index.js`, or the root
|
|
11
|
+
* `dist/index.js`) drags `dist/parg/runtime.js`, whose module scope
|
|
12
|
+
* walks up to a package.json through node:fs — impossible in a worker
|
|
13
|
+
* bundle. This entry composes the parg-free registration manifest
|
|
14
|
+
* (./flavors/register-types.js) with the codec, so
|
|
15
|
+
*
|
|
16
|
+
* import { PubidUrn } from "@pubid/pubid/register-types.js";
|
|
17
|
+
*
|
|
18
|
+
* covers every flavor in a worker. The grammar-backed
|
|
19
|
+
* `grammarImplementation` (open-ended parse routing) deliberately stays
|
|
20
|
+
* behind the node-only barrel: it cannot load in a worker today.
|
|
21
|
+
*/
|
|
22
|
+
import "./flavors/register-types.js";
|
|
23
|
+
export * as PubidUrn from "./pubid-urn/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubid/pubid",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"description": "TypeScript PubID identifiers: resolution, normalization and canonical hashes for every identifier in the pubid-testsuite corpus (41 standards bodies), with a conformance runner mirroring the Ruby reference",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/vendor/parg/cen_pfs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidCenPfs","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Str":{"pattern":"EN"}},{"Str":{"pattern":" "}},{"Entity":{"atom":8}},{"Re":{"pattern":"[\\x31-\\x39]"}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":4,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[3,6]}},{"Named":{"name":"number","atom":7}},{"Str":{"pattern":"-"}},{"Entity":{"atom":13}},{"Entity":{"atom":5}},{"Repetition":{"atom":11,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":12}},{"Sequence":{"atoms":[9,10]}},{"Repetition":{"atom":14,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":":"}},{"Entity":{"atom":20}},{"Entity":{"atom":5}},{"Repetition":{"atom":18,"min":4,"max":null,"tag":"Repetition"}},{"Named":{"name":"year","atom":19}},{"Sequence":{"atoms":[16,17]}},{"Repetition":{"atom":21,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,1,2,15,22]}}],"root":23},"bindings":[{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"part","path":"part","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"EN 1325","expect":{}},{"entry":"identifier","kind":"accept","input":"EN 12464-1:2011","expect":{}},{"entry":"identifier","kind":"accept","input":"EN 1177:2018","expect":{}},{"entry":"identifier","kind":"reject","input":"EN","expect":{}},{"entry":"identifier","kind":"reject","input":"EN ISO 9001:2015","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"CEN/TS 12345","expect":{}},{"entry":"identifier","kind":"example","input":"EN 1325","expect":{"number":"1325"}},{"entry":"identifier","kind":"example","input":"EN 12464-1:2011","expect":{"number":"12464","part":"1","year":"2011"}},{"entry":"identifier","kind":"example","input":"EN 1177:2018","expect":{"number":"1177","year":"2018"}}],"docs":{},"source":"# PFS-generated grammar — DO NOT EDIT BY HAND.\n# Source: definitions/cen.pfs (pfs:1) sha256:bc1edd5874f8938b5f946416a2b052d9d9b9df3d99f6c20a3d88fcab9ae1d70c\n# Compiler: pubid/grammar/pfs 0.1.0\n# Flavor key: cen_pfs (grammar PubidCenPfs)\n# Regenerate: ruby scripts/pfs compile definitions/cen.pfs --as cen_pfs\n# Module: iso.inner v1 (sha256:
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidCenPfs","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Str":{"pattern":"EN"}},{"Str":{"pattern":" "}},{"Entity":{"atom":8}},{"Re":{"pattern":"[\\x31-\\x39]"}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":4,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[3,6]}},{"Named":{"name":"number","atom":7}},{"Str":{"pattern":"-"}},{"Entity":{"atom":13}},{"Entity":{"atom":5}},{"Repetition":{"atom":11,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":12}},{"Sequence":{"atoms":[9,10]}},{"Repetition":{"atom":14,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":":"}},{"Entity":{"atom":20}},{"Entity":{"atom":5}},{"Repetition":{"atom":18,"min":4,"max":null,"tag":"Repetition"}},{"Named":{"name":"year","atom":19}},{"Sequence":{"atoms":[16,17]}},{"Repetition":{"atom":21,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,1,2,15,22]}}],"root":23},"bindings":[{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"part","path":"part","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"EN 1325","expect":{}},{"entry":"identifier","kind":"accept","input":"EN 12464-1:2011","expect":{}},{"entry":"identifier","kind":"accept","input":"EN 1177:2018","expect":{}},{"entry":"identifier","kind":"reject","input":"EN","expect":{}},{"entry":"identifier","kind":"reject","input":"EN ISO 9001:2015","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"CEN/TS 12345","expect":{}},{"entry":"identifier","kind":"example","input":"EN 1325","expect":{"number":"1325"}},{"entry":"identifier","kind":"example","input":"EN 12464-1:2011","expect":{"number":"12464","part":"1","year":"2011"}},{"entry":"identifier","kind":"example","input":"EN 1177:2018","expect":{"number":"1177","year":"2018"}}],"docs":{},"source":"# PFS-generated grammar — DO NOT EDIT BY HAND.\n# Source: definitions/cen.pfs (pfs:1) sha256:bc1edd5874f8938b5f946416a2b052d9d9b9df3d99f6c20a3d88fcab9ae1d70c\n# Compiler: pubid/grammar/pfs 0.1.0\n# Flavor key: cen_pfs (grammar PubidCenPfs)\n# Regenerate: ruby scripts/pfs compile definitions/cen.pfs --as cen_pfs\n# Module: iso.inner v1 (sha256:7a088d2a7814...)\n# Module: en.overlay v1 (sha256:b92ac2b27544...)\n# Module: national.prefix v1 (sha256:c7aa2f2442e8...)\n# Module: supplements.core v1 (sha256:9fa9656375c7...)\n\ngrammar PubidCenPfs version \"0.1.0\" edition 2 {\n\n # Grammar fragments: named lexical terms declared under `grammar:`.\n iso_space = \" \"\n iso_colon = \":\"\n iso_dash = \"-\"\n iso_year = 4*digit\n iso_part = 1*digit [\"-\" 1*digit]\n iso_number = 1*(\"0\" %x31-39) as iso_zero_lead *digit [iso_dash iso_part]\n iso_document = \"ISO\" iso_space iso_number [iso_colon iso_year]\n en_space = \" \"\n en_draft = (\"pr\" / \"Fpr\") as en_draft_kind\n en_face = [en_draft] \"EN\"\n en_adoption = en_face en_space iso_document\n supplement_number = 1*digit\n supplement_year = 4*digit\n supplement_month = 2*digit\n digit = %x30-39\n space = \" \"\n slash = \"/\"\n colon = \":\"\n dash = \"-\"\n\n # Fields: one capture rule per declared field; the whole pattern\n # is the capture.\n cen_cenelec_number = ((%x31-39) *digit) as number\n cen_cenelec_part = (1*digit) as part\n cen_cenelec_year = (4*digit) as year\n\n # Identifier rule: the canonical template first, then the\n # declared alternates (parse-in spellings; they normalize to the\n # canonical render face).\n identifier = \"EN\" \" \" cen_cenelec_number [\"-\" cen_cenelec_part] [\":\" cen_cenelec_year]\n entry identifier: identifier\n\n # Typed model bindings: every bound capture lands on the\n # consumer model's field of the same name.\n bindings identifier {\n number -> number (string)\n part -> part (string)\n year -> year (string)\n }\n\n # REQUIRED examples from the definition — accepts, rejects, and\n # the capture expectations the compiler replayed at compile time.\n test {\n accept \"EN 1325\"\n accept \"EN 12464-1:2011\"\n accept \"EN 1177:2018\"\n reject \"EN\"\n reject \"EN ISO 9001:2015\"\n reject \"nonsense\"\n reject \"CEN/TS 12345\"\n example \"EN 1325\" { number: \"1325\" }\n example \"EN 12464-1:2011\" { number: \"12464\" part: \"1\" year: \"2011\" }\n example \"EN 1177:2018\" { number: \"1177\" year: \"2018\" }\n }\n}\n","source_hash":"c3ec2cd6e0f6d3a00433ab59fb2c205dcdf2e1004179c79b1c6484f92d2a17e0","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.126","edition":2,"semantics_hash":"sha256:dac473f625b6a8eafd3486ccf837ea983ba33c436209b9e5a5a274629583947e","checksum":"sha256:23319edbdb9441f7dd52782d030efdea7b2e365935e6d92e979900199847ffbd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidEtsiPfs","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Str":{"pattern":"ETSI "}},{"Entity":{"atom":18}},{"Str":{"pattern":"I-ETS"}},{"Str":{"pattern":"TCRTR"}},{"Str":{"pattern":"GTS"}},{"Str":{"pattern":"ETR"}},{"Str":{"pattern":"ETS"}},{"Str":{"pattern":"TBR"}},{"Str":{"pattern":"NET"}},{"Str":{"pattern":"EN"}},{"Str":{"pattern":"ES"}},{"Str":{"pattern":"EG"}},{"Str":{"pattern":"TS"}},{"Str":{"pattern":"GR"}},{"Str":{"pattern":"GS"}},{"Str":{"pattern":"SR"}},{"Str":{"pattern":"TR"}},{"Alternative":{"atoms":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}},{"Named":{"name":"type","atom":17}},{"Str":{"pattern":" "}},{"Entity":{"atom":54}},{"Str":{"pattern":"GSM"}},{"Str":{"pattern":" "}},{"Entity":{"atom":24}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":23,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Entity":{"atom":24}},{"Repetition":{"atom":27,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[21,22,25,26,28]}},{"Entity":{"atom":24}},{"Repetition":{"atom":30,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Entity":{"atom":24}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[31,32,34]}},{"Entity":{"atom":40}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[37,38,39]}},{"Repetition":{"atom":36,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Entity":{"atom":40}},{"Repetition":{"atom":43,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[42,44]}},{"Repetition":{"atom":45,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":24}},{"Repetition":{"atom":48,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[41,46,47,49]}},{"Entity":{"atom":24}},{"Repetition":{"atom":51,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[29,35,50,52]}},{"Named":{"name":"number","atom":53}},{"Sequence":{"atoms":[0,1,19,20]}},{"Str":{"pattern":"ETSI "}},{"Entity":{"atom":18}},{"Str":{"pattern":" "}},{"Entity":{"atom":54}},{"Str":{"pattern":" "}},{"Entity":{"atom":64}},{"Entity":{"atom":24}},{"Repetition":{"atom":62,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"minor","atom":63}},{"Sequence":{"atoms":[60,61]}},{"Repetition":{"atom":65,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":73}},{"Str":{"pattern":"-"}},{"Entity":{"atom":40}},{"Repetition":{"atom":69,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[68,70]}},{"Repetition":{"atom":71,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"parts","atom":72}},{"Repetition":{"atom":67,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":83}},{"Str":{"pattern":"/A"}},{"Str":{"pattern":"/C"}},{"Alternative":{"atoms":[76,77]}},{"Entity":{"atom":24}},{"Repetition":{"atom":79,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[78,80]}},{"Repetition":{"atom":81,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplements","atom":82}},{"Repetition":{"atom":75,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" V"}},{"Entity":{"atom":92}},{"Entity":{"atom":90}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[.]"}},{"Alternative":{"atoms":[88,89]}},{"Repetition":{"atom":87,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"version","atom":91}},{"Sequence":{"atoms":[85,86]}},{"Str":{"pattern":" ed."}},{"Entity":{"atom":98}},{"Entity":{"atom":24}},{"Repetition":{"atom":96,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"edition","atom":97}},{"Sequence":{"atoms":[94,95]}},{"Alternative":{"atoms":[93,99]}},{"Repetition":{"atom":100,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" ("}},{"Entity":{"atom":106}},{"Entity":{"atom":24}},{"Repetition":{"atom":104,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":105}},{"Str":{"pattern":"-"}},{"Entity":{"atom":111}},{"Entity":{"atom":24}},{"Repetition":{"atom":109,"min":2,"max":2,"tag":"Repetition"}},{"Named":{"name":"month","atom":110}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[102,103,107,108,112]}},{"Repetition":{"atom":113,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[56,57,58,59,66,74,84,101,114]}},{"Alternative":{"atoms":[55,115]}}],"root":116},"bindings":[{"capture":"type","path":"type","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"minor","path":"minor","type":"string","card":null,"preprocess":null},{"capture":"parts","path":"parts","type":"string","card":null,"preprocess":null},{"capture":"supplements","path":"supplements","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null},{"capture":"edition","path":"edition","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"month","path":"month","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)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"ETSI EG 200 053 V1.5.1 (2004-06)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EN 300 175","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EN 300 175-2","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EN 300 019-1-0 V2.1.2 (2003-09)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI TS 103 702","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EG 201 880 V1.2.1","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI GTS GSM 02.01 V5.5.0 (1999-08)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI I-ETS 300 003 ed.1 (1991-08)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI ETR 108/A1 ed.1 (1995-08)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI XX 100","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 V","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 V1.2.x","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 (","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 (2004-6)","expect":{}},{"entry":"identifier","kind":"example","input":"ETSI EG 200 053 V1.5.1 (2004-06)","expect":{"type":"EG","number":"200 053","version":"1.5.1","year":"2004","month":"06"}},{"entry":"identifier","kind":"example","input":"ETSI EN 300 175","expect":{"type":"EN","number":"300 175"}},{"entry":"identifier","kind":"example","input":"ETSI EN 300 175-2","expect":{"type":"EN","number":"300 175","parts":"-2"}},{"entry":"identifier","kind":"example","input":"ETSI EN 300 019-1-0 V2.1.2 (2003-09)","expect":{"type":"EN","number":"300 019","parts":"-1-0","version":"2.1.2","year":"2003","month":"09"}},{"entry":"identifier","kind":"example","input":"ETSI TS 103 702","expect":{"type":"TS","number":"103 702"}},{"entry":"identifier","kind":"example","input":"ETSI EG 201 880 V1.2.1","expect":{"type":"EG","number":"201 880","version":"1.2.1"}},{"entry":"identifier","kind":"example","input":"ETSI GTS GSM 02.01 V5.5.0 (1999-08)","expect":{"type":"GTS","number":"GSM 02.01","version":"5.5.0","year":"1999","month":"08"}},{"entry":"identifier","kind":"example","input":"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)","expect":{"type":"GR","number":"NFV-EVE 008","version":"3.1.1","year":"2017","month":"12"}},{"entry":"identifier","kind":"example","input":"ETSI I-ETS 300 003 ed.1 (1991-08)","expect":{"type":"I-ETS","number":"300 003","edition":"1","year":"1991","month":"08"}},{"entry":"identifier","kind":"example","input":"ETSI ETR 108/A1 ed.1 (1995-08)","expect":{"type":"ETR","number":"108","supplements":"/A1","edition":"1","year":"1995","month":"08"}},{"entry":"identifier","kind":"example","input":"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)","expect":{"type":"ETS","number":"300 092","parts":"-1","supplements":"/A1/C1","edition":"1","year":"1994","month":"04"}}],"docs":{},"source":"# PFS-generated grammar — DO NOT EDIT BY HAND.\n# Source: definitions/etsi.pfs (pfs:1) sha256:9343088bf087b55ea790057e6be0bbebe2272407ee81f035b52e5f9a4d5c7b76\n# Compiler: pubid/grammar/pfs 0.1.0\n# Flavor key: etsi_pfs (grammar PubidEtsiPfs)\n# Regenerate: ruby scripts/pfs compile definitions/etsi.pfs --as etsi_pfs\n\ngrammar PubidEtsiPfs version \"0.1.0\" edition 2 {\n\n # Grammar fragments: named lexical terms declared under `grammar:`.\n digit = %x30-39\n alnum_char = %x41-5A / %x61-7A / %x30-39\n version_char = %x30-39 / %x2E\n\n # Fields: one capture rule per declared field; the whole pattern\n # is the capture.\n etsi_type = (\"I-ETS\" / \"TCRTR\" / \"GTS\" / \"ETR\" / \"ETS\" / \"TBR\" / \"NET\" / \"EN\" / \"ES\" / \"EG\" / \"TS\" / \"GR\" / \"GS\" / \"SR\" / \"TR\") as type\n etsi_number = ((\"GSM\" \" \" 1*digit \".\" 1*digit) / (1*digit \".\" 1*digit) / (1*alnum_char [(\"-\" 1*alnum_char)] \" \" 1*digit) / (1*digit)) as number\n etsi_minor = (1*digit) as minor\n etsi_parts = (1*(\"-\" 1*alnum_char)) as parts\n etsi_supplements = (1*((\"/A\" / \"/C\") 1*digit)) as supplements\n etsi_version = (1*version_char) as version\n etsi_edition = (1*digit) as edition\n etsi_year = (4digit) as year\n etsi_month = (2digit) as month\n\n # Identifier rule: the canonical template first, then the\n # declared alternates (parse-in spellings; they normalize to the\n # canonical render face).\n identifier = {\n \"ETSI \" etsi_type \" \" etsi_number\n / \"ETSI \" etsi_type \" \" etsi_number [\" \" etsi_minor] [etsi_parts] [etsi_supplements] [( \" V\" etsi_version / \" ed.\" etsi_edition )] [\" (\" etsi_year \"-\" etsi_month \")\"]\n }\n entry identifier: identifier\n\n # Typed model bindings: every bound capture lands on the\n # consumer model's field of the same name.\n bindings identifier {\n type -> type (string)\n number -> number (string)\n minor -> minor (string)\n parts -> parts (string)\n supplements -> supplements (string)\n version -> version (string)\n edition -> edition (string)\n year -> year (string)\n month -> month (string)\n }\n\n # REQUIRED examples from the definition — accepts, rejects, and\n # the capture expectations the compiler replayed at compile time.\n test {\n accept \"ETSI EG 200 053 V1.5.1 (2004-06)\"\n accept \"ETSI EN 300 175\"\n accept \"ETSI EN 300 175-2\"\n accept \"ETSI EN 300 019-1-0 V2.1.2 (2003-09)\"\n accept \"ETSI TS 103 702\"\n accept \"ETSI EG 201 880 V1.2.1\"\n accept \"ETSI GTS GSM 02.01 V5.5.0 (1999-08)\"\n accept \"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)\"\n accept \"ETSI I-ETS 300 003 ed.1 (1991-08)\"\n accept \"ETSI ETR 108/A1 ed.1 (1995-08)\"\n accept \"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)\"\n reject \"nonsense\"\n reject \"ETSI\"\n reject \"ETSI EN\"\n reject \"ETSI XX 100\"\n reject \"ETSI EN 300 175 V\"\n reject \"ETSI EN 300 175 V1.2.x\"\n reject \"ETSI EN 300 175 (\"\n reject \"ETSI EN 300 175 (2004-6)\"\n example \"ETSI EG 200 053 V1.5.1 (2004-06)\" { type: \"EG\" number: \"200 053\" version: \"1.5.1\" year: \"2004\" month: \"06\" }\n example \"ETSI EN 300 175\" { type: \"EN\" number: \"300 175\" }\n example \"ETSI EN 300 175-2\" { type: \"EN\" number: \"300 175\" parts: \"-2\" }\n example \"ETSI EN 300 019-1-0 V2.1.2 (2003-09)\" { type: \"EN\" number: \"300 019\" parts: \"-1-0\" version: \"2.1.2\" year: \"2003\" month: \"09\" }\n example \"ETSI TS 103 702\" { type: \"TS\" number: \"103 702\" }\n example \"ETSI EG 201 880 V1.2.1\" { type: \"EG\" number: \"201 880\" version: \"1.2.1\" }\n example \"ETSI GTS GSM 02.01 V5.5.0 (1999-08)\" { type: \"GTS\" number: \"GSM 02.01\" version: \"5.5.0\" year: \"1999\" month: \"08\" }\n example \"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)\" { type: \"GR\" number: \"NFV-EVE 008\" version: \"3.1.1\" year: \"2017\" month: \"12\" }\n example \"ETSI I-ETS 300 003 ed.1 (1991-08)\" { type: \"I-ETS\" number: \"300 003\" edition: \"1\" year: \"1991\" month: \"08\" }\n example \"ETSI ETR 108/A1 ed.1 (1995-08)\" { type: \"ETR\" number: \"108\" supplements: \"/A1\" edition: \"1\" year: \"1995\" month: \"08\" }\n example \"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)\" { type: \"ETS\" number: \"300 092\" parts: \"-1\" supplements: \"/A1/C1\" edition: \"1\" year: \"1994\" month: \"04\" }\n }\n}\n","source_hash":"f5e47bb403d9bff4737d8a200f08c71f8029df12f96c56e9774b722908bfa853","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.126","edition":2,"semantics_hash":"sha256:204a90b72aa2ea5fc2249622bd61c052b4ba5d1ebf732a2c2b57669c8de24393","checksum":"sha256:d861e040f36868dcef43c6547c5791979d4832d1ec1ca6bc310bdad82ea0e930"}
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidEtsiPfs","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Str":{"pattern":"ETSI "}},{"Entity":{"atom":18}},{"Str":{"pattern":"I-ETS"}},{"Str":{"pattern":"TCRTR"}},{"Str":{"pattern":"GTS"}},{"Str":{"pattern":"ETR"}},{"Str":{"pattern":"ETS"}},{"Str":{"pattern":"TBR"}},{"Str":{"pattern":"NET"}},{"Str":{"pattern":"EN"}},{"Str":{"pattern":"ES"}},{"Str":{"pattern":"EG"}},{"Str":{"pattern":"TS"}},{"Str":{"pattern":"GR"}},{"Str":{"pattern":"GS"}},{"Str":{"pattern":"SR"}},{"Str":{"pattern":"TR"}},{"Alternative":{"atoms":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}},{"Named":{"name":"type","atom":17}},{"Str":{"pattern":" "}},{"Entity":{"atom":54}},{"Str":{"pattern":"GSM"}},{"Str":{"pattern":" "}},{"Entity":{"atom":24}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":23,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Entity":{"atom":24}},{"Repetition":{"atom":27,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[21,22,25,26,28]}},{"Entity":{"atom":24}},{"Repetition":{"atom":30,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Entity":{"atom":24}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[31,32,34]}},{"Entity":{"atom":40}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[37,38,39]}},{"Repetition":{"atom":36,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Entity":{"atom":40}},{"Repetition":{"atom":43,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[42,44]}},{"Repetition":{"atom":45,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":24}},{"Repetition":{"atom":48,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[41,46,47,49]}},{"Entity":{"atom":24}},{"Repetition":{"atom":51,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[29,35,50,52]}},{"Named":{"name":"number","atom":53}},{"Str":{"pattern":" "}},{"Entity":{"atom":59}},{"Entity":{"atom":24}},{"Repetition":{"atom":57,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"minor","atom":58}},{"Sequence":{"atoms":[55,56]}},{"Repetition":{"atom":60,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":70}},{"Str":{"pattern":"-"}},{"Entity":{"atom":67}},{"Entity":{"atom":40}},{"Repetition":{"atom":65,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":66}},{"Sequence":{"atoms":[63,64]}},{"Repetition":{"atom":68,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"parts","atom":69}},{"Repetition":{"atom":62,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":87}},{"Entity":{"atom":85}},{"Str":{"pattern":"/"}},{"Entity":{"atom":79}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"C"}},{"Alternative":{"atoms":[76,77]}},{"Named":{"name":"supplement_kind","atom":78}},{"Entity":{"atom":83}},{"Entity":{"atom":24}},{"Repetition":{"atom":81,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplement_number","atom":82}},{"Sequence":{"atoms":[74,75,80]}},{"Named":{"name":"supplement","atom":84}},{"Repetition":{"atom":73,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplements","atom":86}},{"Str":{"pattern":" V"}},{"Entity":{"atom":95}},{"Entity":{"atom":93}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[.]"}},{"Alternative":{"atoms":[91,92]}},{"Repetition":{"atom":90,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"version","atom":94}},{"Sequence":{"atoms":[88,89]}},{"Str":{"pattern":" ed."}},{"Entity":{"atom":101}},{"Entity":{"atom":24}},{"Repetition":{"atom":99,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"edition","atom":100}},{"Sequence":{"atoms":[97,98]}},{"Alternative":{"atoms":[96,102]}},{"Repetition":{"atom":103,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" ("}},{"Entity":{"atom":109}},{"Entity":{"atom":24}},{"Repetition":{"atom":107,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":108}},{"Str":{"pattern":"-"}},{"Entity":{"atom":114}},{"Entity":{"atom":24}},{"Repetition":{"atom":112,"min":2,"max":2,"tag":"Repetition"}},{"Named":{"name":"month","atom":113}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[105,106,110,111,115]}},{"Repetition":{"atom":116,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,1,19,20,61,71,72,104,117]}},{"Str":{"pattern":"ETSI "}},{"Entity":{"atom":18}},{"Str":{"pattern":" "}},{"Entity":{"atom":54}},{"Str":{"pattern":" "}},{"Entity":{"atom":59}},{"Sequence":{"atoms":[123,124]}},{"Repetition":{"atom":125,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":70}},{"Repetition":{"atom":127,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":87}},{"Repetition":{"atom":129,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" V"}},{"Entity":{"atom":95}},{"Sequence":{"atoms":[131,132]}},{"Str":{"pattern":" ed."}},{"Entity":{"atom":101}},{"Sequence":{"atoms":[134,135]}},{"Alternative":{"atoms":[133,136]}},{"Repetition":{"atom":137,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" ("}},{"Entity":{"atom":109}},{"Str":{"pattern":"-"}},{"Entity":{"atom":114}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[139,140,141,142,143]}},{"Repetition":{"atom":144,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[119,120,121,122,126,128,130,138,145]}},{"Alternative":{"atoms":[118,146]}}],"root":147},"bindings":[{"capture":"type","path":"type","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"minor","path":"minor","type":"string","card":null,"preprocess":null},{"capture":"part","path":"part","type":"string","card":null,"preprocess":null},{"capture":"part","path":"parts[].part","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null},{"capture":"edition","path":"edition","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"month","path":"month","type":"string","card":null,"preprocess":null},{"capture":"supplement","path":"supplements[].supplement","type":"raw","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)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"ETSI EG 200 053 V1.5.1 (2004-06)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EN 300 175","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EN 300 175-2","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EN 300 019-1-0 V2.1.2 (2003-09)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI TS 103 702","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI EG 201 880 V1.2.1","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI GTS GSM 02.01 V5.5.0 (1999-08)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI I-ETS 300 003 ed.1 (1991-08)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI ETR 108/A1 ed.1 (1995-08)","expect":{}},{"entry":"identifier","kind":"accept","input":"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI XX 100","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 V","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 V1.2.x","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 (","expect":{}},{"entry":"identifier","kind":"reject","input":"ETSI EN 300 175 (2004-6)","expect":{}},{"entry":"identifier","kind":"example","input":"ETSI EG 200 053 V1.5.1 (2004-06)","expect":{"type":"EG","number":"200 053","version":"1.5.1","year":"2004","month":"06"}},{"entry":"identifier","kind":"example","input":"ETSI EN 300 175","expect":{"type":"EN","number":"300 175"}},{"entry":"identifier","kind":"example","input":"ETSI EN 300 175-2","expect":{"type":"EN","number":"300 175","part":"2"}},{"entry":"identifier","kind":"example","input":"ETSI EN 300 019-1-0 V2.1.2 (2003-09)","expect":{"type":"EN","number":"300 019","part":"1","version":"2.1.2","year":"2003","month":"09"}},{"entry":"identifier","kind":"example","input":"ETSI TS 103 702","expect":{"type":"TS","number":"103 702"}},{"entry":"identifier","kind":"example","input":"ETSI EG 201 880 V1.2.1","expect":{"type":"EG","number":"201 880","version":"1.2.1"}},{"entry":"identifier","kind":"example","input":"ETSI GTS GSM 02.01 V5.5.0 (1999-08)","expect":{"type":"GTS","number":"GSM 02.01","version":"5.5.0","year":"1999","month":"08"}},{"entry":"identifier","kind":"example","input":"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)","expect":{"type":"GR","number":"NFV-EVE 008","version":"3.1.1","year":"2017","month":"12"}},{"entry":"identifier","kind":"example","input":"ETSI I-ETS 300 003 ed.1 (1991-08)","expect":{"type":"I-ETS","number":"300 003","edition":"1","year":"1991","month":"08"}},{"entry":"identifier","kind":"example","input":"ETSI ETR 108/A1 ed.1 (1995-08)","expect":{"type":"ETR","number":"108","edition":"1","year":"1995","month":"08"}},{"entry":"identifier","kind":"example","input":"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)","expect":{"type":"ETS","number":"300 092","part":"1","edition":"1","year":"1994","month":"04"}}],"docs":{},"source":"# PFS-generated grammar — DO NOT EDIT BY HAND.\n# Source: definitions/etsi.pfs (pfs:1) sha256:490ba9435f44dbd2d59429ae6d9527909c39444f19fec5a33a8cad91e89e3581\n# Compiler: pubid/grammar/pfs 0.1.0\n# Flavor key: etsi_pfs (grammar PubidEtsiPfs)\n# Regenerate: ruby scripts/pfs compile definitions/etsi.pfs --as etsi_pfs\n\ngrammar PubidEtsiPfs version \"0.1.0\" edition 2 {\n\n # Grammar fragments: named lexical terms declared under `grammar:`.\n digit = %x30-39\n alnum_char = %x41-5A / %x61-7A / %x30-39\n version_char = %x30-39 / %x2E\n\n # Fields: one capture rule per declared field; the whole pattern\n # is the capture.\n etsi_type = (\"I-ETS\" / \"TCRTR\" / \"GTS\" / \"ETR\" / \"ETS\" / \"TBR\" / \"NET\" / \"EN\" / \"ES\" / \"EG\" / \"TS\" / \"GR\" / \"GS\" / \"SR\" / \"TR\") as type\n etsi_number = ((\"GSM\" \" \" 1*digit \".\" 1*digit) / (1*digit \".\" 1*digit) / (1*alnum_char [(\"-\" 1*alnum_char)] \" \" 1*digit) / (1*digit)) as number\n etsi_minor = (1*digit) as minor\n etsi_part = (1*alnum_char) as part\n etsi_parts = (1*(\"-\" etsi_part)) as parts\n etsi_version = (1*version_char) as version\n etsi_edition = (1*digit) as edition\n etsi_year = (4digit) as year\n etsi_month = (2digit) as month\n\n # Supplement run (compiled from the supplements declaration):\n # each item binds its kind face and ordinal; the builder folds\n # the run into the declared wrapper classes.\n etsi_supplement_kind = (\"A\" / \"C\") as supplement_kind\n etsi_supplement_number = (1*digit) as supplement_number\n etsi_supplement = ( \"/\" etsi_supplement_kind etsi_supplement_number ) as supplement\n etsi_supplements = (1*etsi_supplement) as supplements\n\n # Identifier rule: the canonical template first, then the\n # declared alternates (parse-in spellings; they normalize to the\n # canonical render face).\n identifier = {\n \"ETSI \" etsi_type \" \" etsi_number [\" \" etsi_minor] [etsi_parts] etsi_supplements [( \" V\" etsi_version / \" ed.\" etsi_edition )] [\" (\" etsi_year \"-\" etsi_month \")\"]\n / \"ETSI \" etsi_type \" \" etsi_number [\" \" etsi_minor] [etsi_parts] [etsi_supplements] [( \" V\" etsi_version / \" ed.\" etsi_edition )] [\" (\" etsi_year \"-\" etsi_month \")\"]\n }\n entry identifier: identifier\n\n # Typed model bindings: every bound capture lands on the\n # consumer model's field of the same name.\n bindings identifier {\n type -> type (string)\n number -> number (string)\n minor -> minor (string)\n part -> part (string)\n part -> parts[].part (string)\n version -> version (string)\n edition -> edition (string)\n year -> year (string)\n month -> month (string)\n supplement -> supplements[].supplement (raw)\n }\n\n # REQUIRED examples from the definition — accepts, rejects, and\n # the capture expectations the compiler replayed at compile time.\n test {\n accept \"ETSI EG 200 053 V1.5.1 (2004-06)\"\n accept \"ETSI EN 300 175\"\n accept \"ETSI EN 300 175-2\"\n accept \"ETSI EN 300 019-1-0 V2.1.2 (2003-09)\"\n accept \"ETSI TS 103 702\"\n accept \"ETSI EG 201 880 V1.2.1\"\n accept \"ETSI GTS GSM 02.01 V5.5.0 (1999-08)\"\n accept \"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)\"\n accept \"ETSI I-ETS 300 003 ed.1 (1991-08)\"\n accept \"ETSI ETR 108/A1 ed.1 (1995-08)\"\n accept \"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)\"\n reject \"nonsense\"\n reject \"ETSI\"\n reject \"ETSI EN\"\n reject \"ETSI XX 100\"\n reject \"ETSI EN 300 175 V\"\n reject \"ETSI EN 300 175 V1.2.x\"\n reject \"ETSI EN 300 175 (\"\n reject \"ETSI EN 300 175 (2004-6)\"\n example \"ETSI EG 200 053 V1.5.1 (2004-06)\" { type: \"EG\" number: \"200 053\" version: \"1.5.1\" year: \"2004\" month: \"06\" }\n example \"ETSI EN 300 175\" { type: \"EN\" number: \"300 175\" }\n example \"ETSI EN 300 175-2\" { type: \"EN\" number: \"300 175\" part: \"2\" }\n example \"ETSI EN 300 019-1-0 V2.1.2 (2003-09)\" { type: \"EN\" number: \"300 019\" part: \"1\" version: \"2.1.2\" year: \"2003\" month: \"09\" }\n example \"ETSI TS 103 702\" { type: \"TS\" number: \"103 702\" }\n example \"ETSI EG 201 880 V1.2.1\" { type: \"EG\" number: \"201 880\" version: \"1.2.1\" }\n example \"ETSI GTS GSM 02.01 V5.5.0 (1999-08)\" { type: \"GTS\" number: \"GSM 02.01\" version: \"5.5.0\" year: \"1999\" month: \"08\" }\n example \"ETSI GR NFV-EVE 008 V3.1.1 (2017-12)\" { type: \"GR\" number: \"NFV-EVE 008\" version: \"3.1.1\" year: \"2017\" month: \"12\" }\n example \"ETSI I-ETS 300 003 ed.1 (1991-08)\" { type: \"I-ETS\" number: \"300 003\" edition: \"1\" year: \"1991\" month: \"08\" }\n example \"ETSI ETR 108/A1 ed.1 (1995-08)\" { type: \"ETR\" number: \"108\" edition: \"1\" year: \"1995\" month: \"08\" }\n example \"ETSI ETS 300 092-1/A1/C1 ed.1 (1994-04)\" { type: \"ETS\" number: \"300 092\" part: \"1\" edition: \"1\" year: \"1994\" month: \"04\" }\n }\n}\n","source_hash":"12923bc0c9d666d9c01feb4667bce45e7a3acb7b221bcdc59b4886ecbeda8f92","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.126","edition":2,"semantics_hash":"sha256:1078102d9883a5c7906a15119592a43447800ee5aaca2bbf060ac6394a089aa3","checksum":"sha256:bea8fc40624aa907dd59befc802bf84ee56591ed0130437c2d0fe6065ebaf3d6"}
|