@pubid/pubid 0.1.71 → 0.1.73
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 +22 -4
- package/artifact/corpus.json.gz +0 -0
- package/dist/flavors/ansi/generated/substrate.d.ts +78 -0
- package/dist/flavors/ansi/generated/substrate.js +105 -0
- package/dist/flavors/ansi/implementation.d.ts +5 -0
- package/dist/flavors/ansi/implementation.js +125 -0
- package/dist/flavors/ansi/index.js +14 -117
- package/dist/flavors/api/generated/substrate.d.ts +78 -0
- package/dist/flavors/api/generated/substrate.js +105 -0
- package/dist/flavors/api/grammar.worker.d.ts +6 -0
- package/dist/flavors/api/{grammar.js → grammar.worker.js} +60 -16
- package/dist/flavors/api/implementation.d.ts +11 -0
- package/dist/flavors/api/implementation.js +106 -0
- package/dist/flavors/api/index.d.ts +1 -3
- package/dist/flavors/api/index.js +14 -98
- package/dist/flavors/arxiv/generated/substrate.d.ts +75 -0
- package/dist/flavors/arxiv/generated/substrate.js +102 -0
- package/dist/flavors/arxiv/index.js +17 -11
- package/dist/flavors/ashrae/generated/substrate.d.ts +78 -0
- package/dist/flavors/ashrae/generated/substrate.js +105 -0
- package/dist/flavors/ashrae/grammar.worker.d.ts +6 -0
- package/dist/flavors/ashrae/{grammar.js → grammar.worker.js} +76 -39
- package/dist/flavors/ashrae/implementation.d.ts +7 -0
- package/dist/flavors/ashrae/implementation.js +316 -0
- package/dist/flavors/ashrae/index.d.ts +1 -3
- package/dist/flavors/ashrae/index.js +14 -304
- package/dist/flavors/asme/generated/substrate.d.ts +78 -0
- package/dist/flavors/asme/generated/substrate.js +105 -0
- package/dist/flavors/asme/grammar.worker.d.ts +6 -0
- package/dist/flavors/asme/{grammar.js → grammar.worker.js} +41 -2
- package/dist/flavors/asme/implementation.d.ts +7 -0
- package/dist/flavors/asme/implementation.js +152 -0
- package/dist/flavors/asme/index.d.ts +1 -3
- package/dist/flavors/asme/index.js +14 -136
- package/dist/flavors/astm/generated/substrate.d.ts +78 -0
- package/dist/flavors/astm/generated/substrate.js +105 -0
- package/dist/flavors/astm/grammar.worker.d.ts +6 -0
- package/dist/flavors/astm/{grammar.js → grammar.worker.js} +39 -5
- package/dist/flavors/astm/implementation.d.ts +6 -0
- package/dist/flavors/astm/implementation.js +135 -0
- package/dist/flavors/astm/index.js +14 -125
- package/dist/flavors/bipm/generated/substrate.d.ts +78 -0
- package/dist/flavors/bipm/generated/substrate.js +105 -0
- package/dist/flavors/bipm/grammar.worker.d.ts +6 -0
- package/dist/flavors/bipm/grammar.worker.js +180 -0
- package/dist/flavors/bipm/implementation.d.ts +6 -0
- package/dist/flavors/bipm/implementation.js +244 -0
- package/dist/flavors/bipm/index.d.ts +1 -28
- package/dist/flavors/bipm/index.js +16 -650
- package/dist/flavors/bipm/model.d.ts +80 -0
- package/dist/flavors/bipm/model.js +271 -0
- package/dist/flavors/bipm/worker.d.ts +2 -0
- package/dist/flavors/bipm/worker.js +19 -0
- package/dist/flavors/bsi/generated/substrate.d.ts +78 -0
- package/dist/flavors/bsi/generated/substrate.js +105 -0
- package/dist/flavors/bsi/grammar.worker.d.ts +6 -0
- package/dist/flavors/bsi/{grammar.js → grammar.worker.js} +36 -7
- package/dist/flavors/bsi/implementation.d.ts +12 -0
- package/dist/flavors/bsi/implementation.js +967 -0
- package/dist/flavors/bsi/index.d.ts +1 -3
- package/dist/flavors/bsi/index.js +15 -940
- package/dist/flavors/bsi/model.js +16 -0
- package/dist/flavors/bsi/worker.js +11 -4
- package/dist/flavors/bsi_pfs/index.d.ts +25 -0
- package/dist/flavors/bsi_pfs/index.js +73 -10
- package/dist/flavors/calconnect/generated/substrate.d.ts +75 -0
- package/dist/flavors/calconnect/generated/substrate.js +102 -0
- package/dist/flavors/calconnect/grammar.worker.d.ts +6 -0
- package/dist/flavors/calconnect/grammar.worker.js +60 -0
- package/dist/flavors/calconnect/implementation.d.ts +6 -0
- package/dist/flavors/calconnect/implementation.js +69 -0
- package/dist/flavors/calconnect/index.d.ts +1 -19
- package/dist/flavors/calconnect/index.js +15 -111
- package/dist/flavors/calconnect/model.d.ts +26 -0
- package/dist/flavors/calconnect/model.js +52 -0
- package/dist/flavors/ccsds/generated/substrate.d.ts +75 -0
- package/dist/flavors/ccsds/generated/substrate.js +102 -0
- package/dist/flavors/ccsds/implementation.d.ts +5 -0
- package/dist/flavors/ccsds/implementation.js +67 -0
- package/dist/flavors/ccsds/index.js +13 -57
- package/dist/flavors/cen_cenelec/generated/substrate.d.ts +78 -0
- package/dist/flavors/cen_cenelec/generated/substrate.js +105 -0
- package/dist/flavors/cen_cenelec/grammar.worker.d.ts +6 -0
- package/dist/flavors/cen_cenelec/{grammar.js → grammar.worker.js} +41 -13
- package/dist/flavors/cen_cenelec/implementation.d.ts +15 -0
- package/dist/flavors/cen_cenelec/implementation.js +322 -0
- package/dist/flavors/cen_cenelec/index.d.ts +2 -4
- package/dist/flavors/cen_cenelec/index.js +16 -286
- package/dist/flavors/cen_cenelec/model.js +16 -1
- package/dist/flavors/cen_cenelec/worker.js +10 -4
- package/dist/flavors/cen_pfs/index.d.ts +5 -0
- package/dist/flavors/cen_pfs/index.js +28 -2
- package/dist/flavors/cie/generated/substrate.d.ts +78 -0
- package/dist/flavors/cie/generated/substrate.js +105 -0
- package/dist/flavors/cie/grammar.worker.d.ts +6 -0
- package/dist/flavors/cie/{grammar.js → grammar.worker.js} +71 -18
- package/dist/flavors/cie/implementation.d.ts +9 -0
- package/dist/flavors/cie/implementation.js +331 -0
- package/dist/flavors/cie/index.js +14 -309
- package/dist/flavors/csa/generated/substrate.d.ts +78 -0
- package/dist/flavors/csa/generated/substrate.js +105 -0
- package/dist/flavors/csa/grammar.worker.d.ts +12 -0
- package/dist/flavors/csa/{grammar.js → grammar.worker.js} +143 -27
- package/dist/flavors/csa/implementation.d.ts +9 -0
- package/dist/flavors/csa/implementation.js +661 -0
- package/dist/flavors/csa/index.js +14 -631
- package/dist/flavors/csa/worker.js +10 -4
- package/dist/flavors/easc/generated/substrate.d.ts +75 -0
- package/dist/flavors/easc/generated/substrate.js +102 -0
- package/dist/flavors/easc/grammar.worker.d.ts +6 -0
- package/dist/flavors/easc/grammar.worker.js +66 -0
- package/dist/flavors/easc/implementation.d.ts +6 -0
- package/dist/flavors/easc/implementation.js +58 -0
- package/dist/flavors/easc/index.d.ts +1 -2
- package/dist/flavors/easc/index.js +15 -105
- package/dist/flavors/easc/model.d.ts +10 -0
- package/dist/flavors/easc/model.js +43 -0
- package/dist/flavors/ecma/generated/substrate.d.ts +75 -0
- package/dist/flavors/ecma/generated/substrate.js +102 -0
- package/dist/flavors/ecma/grammar.worker.d.ts +6 -0
- package/dist/flavors/ecma/grammar.worker.js +63 -0
- package/dist/flavors/ecma/implementation.d.ts +6 -0
- package/dist/flavors/ecma/implementation.js +95 -0
- package/dist/flavors/ecma/index.d.ts +1 -2
- package/dist/flavors/ecma/index.js +15 -152
- package/dist/flavors/ecma/model.d.ts +10 -0
- package/dist/flavors/ecma/model.js +61 -0
- package/dist/flavors/etsi/generated/substrate.d.ts +75 -0
- package/dist/flavors/etsi/generated/substrate.js +102 -0
- package/dist/flavors/etsi/grammar.worker.d.ts +6 -0
- package/dist/flavors/etsi/grammar.worker.js +86 -0
- package/dist/flavors/etsi/implementation.d.ts +6 -0
- package/dist/flavors/etsi/implementation.js +110 -0
- package/dist/flavors/etsi/index.d.ts +2 -12
- package/dist/flavors/etsi/index.js +16 -305
- package/dist/flavors/etsi/model.d.ts +37 -0
- package/dist/flavors/etsi/model.js +169 -0
- package/dist/flavors/eu/generated/substrate.d.ts +75 -0
- package/dist/flavors/eu/generated/substrate.js +102 -0
- package/dist/flavors/eu/implementation.d.ts +7 -0
- package/dist/flavors/eu/implementation.js +150 -0
- package/dist/flavors/eu/index.js +14 -141
- package/dist/flavors/evs/generated/substrate.d.ts +78 -0
- package/dist/flavors/evs/generated/substrate.js +105 -0
- package/dist/flavors/evs/grammar.worker.d.ts +6 -0
- package/dist/flavors/evs/grammar.worker.js +98 -0
- package/dist/flavors/evs/implementation.d.ts +7 -0
- package/dist/flavors/evs/implementation.js +114 -0
- package/dist/flavors/evs/index.d.ts +1 -1
- package/dist/flavors/evs/index.js +14 -89
- package/dist/flavors/evs/worker.js +10 -4
- package/dist/flavors/gb/generated/substrate.d.ts +75 -0
- package/dist/flavors/gb/generated/substrate.js +102 -0
- package/dist/flavors/gb/grammar.worker.d.ts +6 -0
- package/dist/flavors/gb/grammar.worker.js +73 -0
- package/dist/flavors/gb/implementation.d.ts +6 -0
- package/dist/flavors/gb/implementation.js +87 -0
- package/dist/flavors/gb/index.d.ts +1 -29
- package/dist/flavors/gb/index.js +15 -157
- package/dist/flavors/gb/model.d.ts +36 -0
- package/dist/flavors/gb/model.js +79 -0
- package/dist/flavors/gost/generated/substrate.d.ts +78 -0
- package/dist/flavors/gost/generated/substrate.js +105 -0
- package/dist/flavors/gost/grammar.worker.d.ts +6 -0
- package/dist/flavors/gost/grammar.worker.js +82 -0
- package/dist/flavors/gost/implementation.d.ts +7 -0
- package/dist/flavors/gost/implementation.js +177 -0
- package/dist/flavors/gost/index.js +14 -162
- package/dist/flavors/gost/worker.js +12 -5
- package/dist/flavors/iala/generated/substrate.d.ts +78 -0
- package/dist/flavors/iala/generated/substrate.js +105 -0
- package/dist/flavors/iala/grammar.worker.d.ts +6 -0
- package/dist/flavors/iala/grammar.worker.js +127 -0
- package/dist/flavors/iala/implementation.d.ts +6 -0
- package/dist/flavors/iala/implementation.js +250 -0
- package/dist/flavors/iala/index.d.ts +1 -56
- package/dist/flavors/iala/index.js +17 -484
- package/dist/flavors/iala/model.d.ts +93 -0
- package/dist/flavors/iala/model.js +194 -0
- package/dist/flavors/iana/generated/substrate.d.ts +75 -0
- package/dist/flavors/iana/generated/substrate.js +102 -0
- package/dist/flavors/iana/grammar.worker.d.ts +6 -0
- package/dist/flavors/iana/grammar.worker.js +51 -0
- package/dist/flavors/iana/implementation.d.ts +6 -0
- package/dist/flavors/iana/implementation.js +47 -0
- package/dist/flavors/iana/index.d.ts +1 -17
- package/dist/flavors/iana/index.js +15 -69
- package/dist/flavors/iana/model.d.ts +22 -0
- package/dist/flavors/iana/model.js +33 -0
- package/dist/flavors/idf/generated/substrate.d.ts +78 -0
- package/dist/flavors/idf/generated/substrate.js +105 -0
- package/dist/flavors/idf/grammar.worker.d.ts +6 -0
- package/dist/flavors/idf/{grammar.js → grammar.worker.js} +58 -2
- package/dist/flavors/idf/implementation.d.ts +6 -0
- package/dist/flavors/idf/implementation.js +129 -0
- package/dist/flavors/idf/index.js +14 -98
- package/dist/flavors/iec/generated/substrate.d.ts +78 -0
- package/dist/flavors/iec/generated/substrate.js +105 -0
- package/dist/flavors/iec/grammar.worker.d.ts +6 -0
- package/dist/flavors/iec/grammar.worker.js +231 -0
- package/dist/flavors/iec/implementation.d.ts +15 -0
- package/dist/flavors/iec/implementation.js +956 -0
- package/dist/flavors/iec/index.d.ts +1 -2
- package/dist/flavors/iec/index.js +16 -869
- package/dist/flavors/iec/model.js +13 -1
- package/dist/flavors/iec/worker.d.ts +2 -0
- package/dist/flavors/iec/worker.js +19 -0
- package/dist/flavors/ieee/generated/substrate.d.ts +78 -0
- package/dist/flavors/ieee/generated/substrate.js +105 -0
- package/dist/flavors/ieee/implementation.d.ts +4 -0
- package/dist/flavors/ieee/implementation.js +48 -10
- package/dist/flavors/ieee/index.d.ts +3 -2
- package/dist/flavors/ieee/index.js +30 -12
- package/dist/flavors/ieee/model.js +17 -4
- package/dist/flavors/ieee/preprocessor.js +11 -10
- package/dist/flavors/ieee/worker.js +33 -11
- package/dist/flavors/ietf/generated/substrate.d.ts +75 -0
- package/dist/flavors/ietf/generated/substrate.js +102 -0
- package/dist/flavors/ietf/grammar.worker.d.ts +6 -0
- package/dist/flavors/ietf/grammar.worker.js +63 -0
- package/dist/flavors/ietf/implementation.d.ts +6 -0
- package/dist/flavors/ietf/implementation.js +60 -0
- package/dist/flavors/ietf/index.d.ts +1 -28
- package/dist/flavors/ietf/index.js +15 -149
- package/dist/flavors/ietf/model.d.ts +47 -0
- package/dist/flavors/ietf/model.js +92 -0
- package/dist/flavors/iho/generated/substrate.d.ts +78 -0
- package/dist/flavors/iho/generated/substrate.js +105 -0
- package/dist/flavors/iho/grammar.worker.d.ts +6 -0
- package/dist/flavors/iho/grammar.worker.js +150 -0
- package/dist/flavors/iho/implementation.d.ts +6 -0
- package/dist/flavors/iho/implementation.js +221 -0
- package/dist/flavors/iho/index.d.ts +1 -2
- package/dist/flavors/iho/index.js +15 -619
- package/dist/flavors/iho/model.d.ts +11 -0
- package/dist/flavors/iho/model.js +315 -0
- package/dist/flavors/index.js +3 -0
- package/dist/flavors/iso/generated/substrate.d.ts +93 -0
- package/dist/flavors/iso/generated/substrate.js +133 -0
- package/dist/flavors/iso/grammar.worker.d.ts +7 -0
- package/dist/flavors/iso/grammar.worker.js +406 -0
- package/dist/flavors/iso/implementation.d.ts +4 -0
- package/dist/flavors/iso/implementation.js +880 -0
- package/dist/flavors/iso/index.js +16 -706
- package/dist/flavors/iso/model.js +21 -2
- package/dist/flavors/iso/worker.d.ts +2 -0
- package/dist/flavors/iso/worker.js +19 -0
- package/dist/flavors/itu/generated/substrate.d.ts +78 -0
- package/dist/flavors/itu/generated/substrate.js +105 -0
- package/dist/flavors/itu/grammar.worker.d.ts +6 -0
- package/dist/flavors/itu/grammar.worker.js +306 -0
- package/dist/flavors/itu/implementation.d.ts +10 -0
- package/dist/flavors/itu/implementation.js +285 -0
- package/dist/flavors/itu/index.js +15 -246
- package/dist/flavors/itu/worker.d.ts +2 -0
- package/dist/flavors/itu/worker.js +19 -0
- package/dist/flavors/jcgm/generated/substrate.d.ts +78 -0
- package/dist/flavors/jcgm/generated/substrate.js +105 -0
- package/dist/flavors/jcgm/grammar.worker.d.ts +6 -0
- package/dist/flavors/jcgm/grammar.worker.js +98 -0
- package/dist/flavors/jcgm/implementation.d.ts +6 -0
- package/dist/flavors/jcgm/implementation.js +187 -0
- package/dist/flavors/jcgm/index.d.ts +1 -5
- package/dist/flavors/jcgm/index.js +16 -364
- package/dist/flavors/jcgm/model.d.ts +43 -0
- package/dist/flavors/jcgm/model.js +168 -0
- package/dist/flavors/jis/generated/substrate.d.ts +78 -0
- package/dist/flavors/jis/generated/substrate.js +105 -0
- package/dist/flavors/jis/grammar.worker.d.ts +6 -0
- package/dist/flavors/jis/grammar.worker.js +132 -0
- package/dist/flavors/jis/implementation.d.ts +6 -0
- package/dist/flavors/jis/implementation.js +129 -0
- package/dist/flavors/jis/index.d.ts +0 -2
- package/dist/flavors/jis/index.js +15 -390
- package/dist/flavors/jis/model.d.ts +30 -0
- package/dist/flavors/jis/model.js +205 -0
- package/dist/flavors/jis/worker.d.ts +2 -0
- package/dist/flavors/jis/worker.js +19 -0
- package/dist/flavors/nist/generated/substrate.d.ts +78 -0
- package/dist/flavors/nist/generated/substrate.js +105 -0
- package/dist/flavors/nist/index.js +18 -11
- package/dist/flavors/nist/worker.js +8 -4
- package/dist/flavors/oasis/generated/substrate.d.ts +75 -0
- package/dist/flavors/oasis/generated/substrate.js +102 -0
- package/dist/flavors/oasis/grammar.worker.d.ts +6 -0
- package/dist/flavors/oasis/grammar.worker.js +50 -0
- package/dist/flavors/oasis/implementation.d.ts +6 -0
- package/dist/flavors/oasis/implementation.js +80 -0
- package/dist/flavors/oasis/index.d.ts +1 -21
- package/dist/flavors/oasis/index.js +16 -108
- package/dist/flavors/oasis/model.d.ts +27 -0
- package/dist/flavors/oasis/model.js +34 -0
- package/dist/flavors/ogc/generated/substrate.d.ts +75 -0
- package/dist/flavors/ogc/generated/substrate.js +102 -0
- package/dist/flavors/ogc/grammar.worker.d.ts +6 -0
- package/dist/flavors/ogc/grammar.worker.js +55 -0
- package/dist/flavors/ogc/implementation.d.ts +6 -0
- package/dist/flavors/ogc/implementation.js +49 -0
- package/dist/flavors/ogc/index.d.ts +1 -18
- package/dist/flavors/ogc/index.js +15 -73
- package/dist/flavors/ogc/model.d.ts +23 -0
- package/dist/flavors/ogc/model.js +32 -0
- package/dist/flavors/oiml/generated/substrate.d.ts +78 -0
- package/dist/flavors/oiml/generated/substrate.js +105 -0
- package/dist/flavors/oiml/grammar.worker.d.ts +6 -0
- package/dist/flavors/oiml/grammar.worker.js +239 -0
- package/dist/flavors/oiml/implementation.d.ts +2 -1
- package/dist/flavors/oiml/implementation.js +16 -7
- package/dist/flavors/oiml/index.js +15 -6
- package/dist/flavors/oiml/model.js +19 -19
- package/dist/flavors/oiml/worker.js +14 -6
- package/dist/flavors/omg/generated/substrate.d.ts +78 -0
- package/dist/flavors/omg/generated/substrate.js +105 -0
- package/dist/flavors/omg/grammar.worker.d.ts +6 -0
- package/dist/flavors/omg/grammar.worker.js +64 -0
- package/dist/flavors/omg/implementation.d.ts +7 -0
- package/dist/flavors/omg/implementation.js +33 -0
- package/dist/flavors/omg/index.d.ts +1 -12
- package/dist/flavors/omg/index.js +15 -71
- package/dist/flavors/omg/model.d.ts +16 -0
- package/dist/flavors/omg/model.js +26 -0
- package/dist/flavors/plateau/generated/substrate.d.ts +78 -0
- package/dist/flavors/plateau/generated/substrate.js +105 -0
- package/dist/flavors/plateau/grammar.worker.d.ts +6 -0
- package/dist/flavors/plateau/grammar.worker.js +78 -0
- package/dist/flavors/plateau/implementation.d.ts +6 -0
- package/dist/flavors/plateau/implementation.js +74 -0
- package/dist/flavors/plateau/index.d.ts +1 -2
- package/dist/flavors/plateau/index.js +18 -114
- package/dist/flavors/plateau/model.d.ts +11 -0
- package/dist/flavors/plateau/model.js +51 -0
- package/dist/flavors/register-types.d.ts +20 -19
- package/dist/flavors/register-types.js +44 -19
- package/dist/flavors/sae/generated/substrate.d.ts +75 -0
- package/dist/flavors/sae/generated/substrate.js +102 -0
- package/dist/flavors/sae/grammar.worker.d.ts +6 -0
- package/dist/flavors/sae/grammar.worker.js +84 -0
- package/dist/flavors/sae/implementation.d.ts +11 -0
- package/dist/flavors/sae/implementation.js +109 -0
- package/dist/flavors/sae/index.d.ts +3 -0
- package/dist/flavors/sae/index.js +19 -0
- package/dist/flavors/sae/model.d.ts +86 -0
- package/dist/flavors/sae/model.js +185 -0
- package/dist/flavors/tgpp/generated/substrate.d.ts +78 -0
- package/dist/flavors/tgpp/generated/substrate.js +105 -0
- package/dist/flavors/tgpp/grammar.worker.d.ts +6 -0
- package/dist/flavors/tgpp/grammar.worker.js +69 -0
- package/dist/flavors/tgpp/implementation.d.ts +8 -0
- package/dist/flavors/tgpp/implementation.js +56 -0
- package/dist/flavors/tgpp/index.d.ts +1 -2
- package/dist/flavors/tgpp/index.js +15 -120
- package/dist/flavors/tgpp/model.d.ts +13 -0
- package/dist/flavors/tgpp/model.js +52 -0
- package/dist/flavors/w3c/generated/substrate.d.ts +78 -0
- package/dist/flavors/w3c/generated/substrate.js +105 -0
- package/dist/flavors/w3c/grammar.worker.d.ts +6 -0
- package/dist/flavors/w3c/grammar.worker.js +55 -0
- package/dist/flavors/w3c/implementation.d.ts +7 -0
- package/dist/flavors/w3c/implementation.js +49 -0
- package/dist/flavors/w3c/index.d.ts +1 -12
- package/dist/flavors/w3c/index.js +15 -146
- package/dist/flavors/w3c/model.d.ts +15 -0
- package/dist/flavors/w3c/model.js +103 -0
- package/dist/flavors/wmo/generated/substrate.d.ts +78 -0
- package/dist/flavors/wmo/generated/substrate.js +105 -0
- package/dist/flavors/wmo/implementation.d.ts +5 -0
- package/dist/flavors/wmo/implementation.js +79 -0
- package/dist/flavors/wmo/index.js +14 -68
- package/dist/flavors/worker-registry.js +246 -68
- package/dist/flavors/xsf/generated/substrate.d.ts +75 -0
- package/dist/flavors/xsf/generated/substrate.js +102 -0
- package/dist/flavors/xsf/grammar.worker.d.ts +6 -0
- package/dist/flavors/xsf/grammar.worker.js +53 -0
- package/dist/flavors/xsf/implementation.d.ts +6 -0
- package/dist/flavors/xsf/implementation.js +34 -0
- package/dist/flavors/xsf/index.d.ts +1 -16
- package/dist/flavors/xsf/index.js +16 -63
- package/dist/flavors/xsf/model.d.ts +20 -0
- package/dist/flavors/xsf/model.js +26 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/lane-keys.d.ts +68 -0
- package/dist/lane-keys.js +113 -0
- package/dist/model/identifier.d.ts +13 -1
- package/dist/model/identifier.js +76 -13
- package/dist/model/relation.d.ts +36 -0
- package/dist/model/relation.js +93 -0
- package/dist/parg/artifacts/ieee.d.ts +1 -1
- package/dist/parg/artifacts/ieee.js +1 -1
- package/dist/parg/worker.d.ts +4 -2
- package/dist/parg/worker.js +5 -3
- package/dist/parse-surface.d.ts +3 -31
- package/dist/parse-surface.js +6 -69
- package/dist/pubid-urn/decoder.d.ts +8 -0
- package/dist/pubid-urn/decoder.js +43 -0
- package/dist/pubid-urn/encoder.js +31 -0
- package/dist/pubid-urn/schema.d.ts +1 -1
- package/dist/pubid-urn/schema.js +1 -1
- package/dist/pubid-urn/schemas/bsi.js +1 -0
- package/dist/pubid-urn/schemas/bsi_pfs.js +9 -7
- package/dist/pubid-urn/schemas/cen_pfs.js +1 -0
- package/dist/pubid-urn/schemas/cencenelec.js +1 -0
- package/dist/pubid-urn/schemas/iec.js +1 -0
- package/dist/pubid-urn/schemas/ieee.js +1 -0
- package/dist/pubid-urn/schemas/iso.js +1 -0
- package/package.json +1 -1
- package/vendor/parg/bsi_pfs.json +1 -1
- package/vendor/parg/calconnect_pfs.json +1 -1
- package/vendor/parg/cen_pfs.json +1 -1
- package/vendor/parg/doi_pfs.json +1 -1
- package/vendor/parg/etsi_pfs.json +1 -1
- package/vendor/parg/ieee.json +1 -1
- package/vendor/parg/iho.json +1 -1
- package/vendor/parg/plateau.json +1 -1
- package/dist/flavors/api/grammar.d.ts +0 -4
- package/dist/flavors/ashrae/grammar.d.ts +0 -2
- package/dist/flavors/asme/grammar.d.ts +0 -2
- package/dist/flavors/astm/grammar.d.ts +0 -2
- package/dist/flavors/bsi/grammar.d.ts +0 -4
- package/dist/flavors/cen_cenelec/grammar.d.ts +0 -4
- package/dist/flavors/cie/grammar.d.ts +0 -5
- package/dist/flavors/csa/grammar.d.ts +0 -6
- package/dist/flavors/evs/grammar.d.ts +0 -2
- package/dist/flavors/evs/grammar.js +0 -68
- package/dist/flavors/gost/grammar.d.ts +0 -2
- package/dist/flavors/gost/grammar.js +0 -46
- package/dist/flavors/idf/grammar.d.ts +0 -2
- package/dist/flavors/iec/grammar.d.ts +0 -3
- package/dist/flavors/iec/grammar.js +0 -234
- package/dist/flavors/ieee/grammar.d.ts +0 -2
- package/dist/flavors/ieee/grammar.js +0 -777
- package/dist/flavors/iso/grammar.d.ts +0 -7
- package/dist/flavors/iso/grammar.js +0 -282
- package/dist/flavors/itu/grammar.d.ts +0 -4
- package/dist/flavors/itu/grammar.js +0 -276
- package/dist/flavors/nist/grammar.d.ts +0 -2
- package/dist/flavors/nist/grammar.js +0 -342
- package/dist/flavors/oiml/grammar.d.ts +0 -2
- package/dist/flavors/oiml/grammar.js +0 -206
- package/vendor/parg/csv.json +0 -1
- package/vendor/parg/ini.json +0 -1
- package/vendor/parg/json.json +0 -1
- package/vendor/parg/lua.json +0 -1
- package/vendor/parg/toml.json +0 -1
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
//! The itu worker engine (pubid/pubid-ts#236 contract): a pure-TS
|
|
2
|
+
//! transcription of grammars/itu.parg (edition 2) — synchronous, no
|
|
3
|
+
//! `node:*` module, no wasm — for the worker entries, where the
|
|
4
|
+
//! artifact runtime's node:fs walk (and the lazy wasm init) cannot run.
|
|
5
|
+
//! Its captures are the artifact's DECLARED wire (the family walks the
|
|
6
|
+
//! builder reads — base/annex_to/combined bind raw, part arrays through
|
|
7
|
+
//! parts[].part, the presence markers keep their captured tokens), so
|
|
8
|
+
//! the shared delta in implementation.ts reads one shape on both
|
|
9
|
+
//! engines, and the codegen differential (pubid-grammar#164's parity
|
|
10
|
+
//! scaffold) pins this engine against the artifact on every corpus row.
|
|
11
|
+
//!
|
|
12
|
+
//! Retirement: this file dies when a worker entry can register the
|
|
13
|
+
//! artifact runtime (the #232 bundled-artifact pattern is async — wasm
|
|
14
|
+
//! init — while the parse API is sync; the gap is a parsanol-ts
|
|
15
|
+
//! follow-up). Until then the differential gate keeps the two engines
|
|
16
|
+
//! locked.
|
|
17
|
+
//!
|
|
18
|
+
//! Edition-2 deviations honored here as in the .parg: every leaf
|
|
19
|
+
//! capture body is spelled at its site (a ref chain inside a capture
|
|
20
|
+
//! breaks the span lowering), the combined-designation tail repeats the
|
|
21
|
+
//! code-suffix shapes under d_* capture names (a capture name at two
|
|
22
|
+
//! structural depths pairs into ONE top-level bound key), and the inner
|
|
23
|
+
//! `designation` capture stays unbound (it rides inside the raw
|
|
24
|
+
//! `combined` array).
|
|
25
|
+
import { match, ref, str } from "../../grammar/engine.js";
|
|
26
|
+
import { ParseFailed, parseGrammar } from "../../grammar/engine.js";
|
|
27
|
+
function buildRules() {
|
|
28
|
+
const rules = {};
|
|
29
|
+
const rule = (name, build) => {
|
|
30
|
+
rules[name] = build();
|
|
31
|
+
};
|
|
32
|
+
const digit = match("[0-9]");
|
|
33
|
+
const digits = digit.repeat(1, Infinity);
|
|
34
|
+
const upper = match("[A-Z]");
|
|
35
|
+
const uppers = upper.repeat(1, 3);
|
|
36
|
+
const space = str(" ");
|
|
37
|
+
const dash = str("-");
|
|
38
|
+
const dot = str(".");
|
|
39
|
+
const yyyymmYear = str("19").or(str("20")).then(digit.repeat(2, 2));
|
|
40
|
+
const yyyymmMonth = str("0").then(match("[1-9]")).or(str("1").then(match("[0-2]")));
|
|
41
|
+
const yyyymmShape = yyyymmYear.then(yyyymmMonth, digit.absent());
|
|
42
|
+
rule("itu_prefix", () => str("Recommendation ").then(str("ITU"), dash.or(space))
|
|
43
|
+
.or(str("ITU").then(dash.or(space))));
|
|
44
|
+
rule("sector", () => str("R").or(str("T")).or(str("D")).as("sector"));
|
|
45
|
+
rule("series", () => str("SG").then(digits).or(uppers).as("series"));
|
|
46
|
+
rule("series_group", () => upper.then(digits.maybe(), dash, digits).as("series"));
|
|
47
|
+
rule("series_word", () => space.then(str("series")).as("series_word"));
|
|
48
|
+
rule("number", () => digits.as("number"));
|
|
49
|
+
rule("subseries", () => dot.then(digits).as("subseries"));
|
|
50
|
+
rule("series_suffix_word", () => str("bis").or(str("ter")).or(str("quater")).or(str("quarter")));
|
|
51
|
+
rule("series_suffix", () => ref(rules, "series_suffix_word").as("series_suffix"));
|
|
52
|
+
rule("series_suffix_spaced", () => space.as("series_suffix_spaced").then(ref(rules, "series_suffix_word").as("series_suffix")));
|
|
53
|
+
rule("qualifier_letter", () => match("[A-R]").or(match("[a-r]"))
|
|
54
|
+
.as("qualifier")
|
|
55
|
+
.then(match("[A-Za-z0-9]").absent()));
|
|
56
|
+
rule("qualifier_glued", () => ref(rules, "qualifier_letter"));
|
|
57
|
+
rule("qualifier_spaced", () => space.as("qualifier_spaced").then(ref(rules, "qualifier_letter")));
|
|
58
|
+
rule("yyyymm_date", () => dash.then(yyyymmYear.as("year"), yyyymmMonth.as("month"), digit.absent()));
|
|
59
|
+
rule("id_status", () => dash.then(str("I").or(str("S")), match("[0-9A-Za-z]").absent()));
|
|
60
|
+
rule("print_id_status", () => dash.then(str("I"), match("[0-9A-Za-z]").absent()));
|
|
61
|
+
rule("id_date", () => ref(rules, "yyyymm_date").then(ref(rules, "print_id_status").maybe()));
|
|
62
|
+
rule("date_part", () => space.then(str("("), digits.as("month").then(str("/")).maybe(), digit.repeat(4, 4).as("year"), str(")")));
|
|
63
|
+
rule("rec_word", () => str("REC").then(space.or(dash)));
|
|
64
|
+
rule("code", () => ref(rules, "imp_code").or(ref(rules, "standard_code")));
|
|
65
|
+
rule("standard_code", () => ref(rules, "number")
|
|
66
|
+
.then(ref(rules, "series_suffix").maybe())
|
|
67
|
+
.then(ref(rules, "subseries").maybe())
|
|
68
|
+
.then(ref(rules, "parts"))
|
|
69
|
+
.then(ref(rules, "qualifier_glued")));
|
|
70
|
+
rule("imp_code", () => str("Imp").as("imp_marker").then(digits.or(uppers).as("number"), ref(rules, "subseries").maybe(), ref(rules, "parts")));
|
|
71
|
+
rule("attachment", () => space.then(str("attachment")).as("attachment"));
|
|
72
|
+
rule("range_end", () => dash.then(uppers.then(dot, digits).as("range_end")));
|
|
73
|
+
rule("part", () => dash.then(yyyymmShape.absent(), digits).as("part"));
|
|
74
|
+
rule("parts", () => ref(rules, "part").repeat(0).as("parts"));
|
|
75
|
+
rule("code_suffixes", () => ref(rules, "series_suffix_spaced").maybe().then(ref(rules, "qualifier_spaced").maybe()));
|
|
76
|
+
rule("version_part", () => space.then(str("(V").then(digits.as("version"), str(")"))
|
|
77
|
+
.or(str("V").or(str("v")).then(dot.maybe(), digits.as("version")))));
|
|
78
|
+
rule("language", () => dash.then(str("E").or(str("F")).or(str("A")).or(str("S")).or(str("C")).or(str("R")).as("language")));
|
|
79
|
+
// The combined-designation tail repeats the code-suffix shapes under
|
|
80
|
+
// d_* capture names (see the header note).
|
|
81
|
+
rule("d_number", () => digits.as("d_number"));
|
|
82
|
+
rule("d_subseries", () => dot.then(digits).as("d_subseries"));
|
|
83
|
+
rule("d_part", () => dash.then(yyyymmShape.absent(), digits).as("d_part"));
|
|
84
|
+
rule("d_parts", () => ref(rules, "d_part").repeat(0).as("d_parts"));
|
|
85
|
+
rule("d_series_suffix", () => ref(rules, "series_suffix_word").as("d_series_suffix"));
|
|
86
|
+
rule("d_series_suffix_spaced", () => space.as("d_series_suffix_spaced").then(ref(rules, "series_suffix_word").as("d_series_suffix")));
|
|
87
|
+
rule("d_qualifier_letter", () => match("[A-R]").or(match("[a-r]"))
|
|
88
|
+
.as("d_qualifier")
|
|
89
|
+
.then(match("[A-Za-z0-9]").absent()));
|
|
90
|
+
rule("d_qualifier_glued", () => ref(rules, "d_qualifier_letter"));
|
|
91
|
+
rule("d_qualifier_spaced", () => space.as("d_qualifier_spaced").then(ref(rules, "d_qualifier_letter")));
|
|
92
|
+
rule("combined_designation", () => str("/").then(ref(rules, "series").then(dot, ref(rules, "d_number"))
|
|
93
|
+
.then(ref(rules, "d_subseries").maybe())
|
|
94
|
+
.then(ref(rules, "d_parts"))
|
|
95
|
+
.then(ref(rules, "d_qualifier_glued"))
|
|
96
|
+
.then(ref(rules, "d_series_suffix_spaced").maybe())
|
|
97
|
+
.then(ref(rules, "d_qualifier_spaced").maybe())
|
|
98
|
+
.as("designation")));
|
|
99
|
+
rule("combined_suffixes", () => ref(rules, "combined_designation").repeat(1, Infinity).as("combined"));
|
|
100
|
+
rule("technical_marker", () => str("Technical").as("technical").then(space));
|
|
101
|
+
rule("supplement_type", () => str("Suppl.").or(str("Suppl")).or(str("Amd.")).or(str("Amd"))
|
|
102
|
+
.or(str("Add.")).or(str("Add")).or(str("Err.")).or(str("Err"))
|
|
103
|
+
.as("supplement_type")
|
|
104
|
+
.or(ref(rules, "technical_marker").maybe().then(str("Cor.").or(str("Cor")).as("supplement_type"))));
|
|
105
|
+
rule("supplement_number", () => space.as("supplement_space").maybe().then(digits.then(dot.then(digits).repeat(0, Infinity)).as("supplement_number")));
|
|
106
|
+
rule("supplement_date", () => space.then(str("("), digits.as("supplement_month").then(str("/")).maybe(), digit.repeat(4, 4).as("supplement_year"), str(")")));
|
|
107
|
+
rule("base_with_series", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
108
|
+
.then(ref(rules, "rec_word").maybe())
|
|
109
|
+
.then(ref(rules, "series"), dot, ref(rules, "code"))
|
|
110
|
+
.then(ref(rules, "range_end").maybe())
|
|
111
|
+
.then(ref(rules, "code_suffixes"))
|
|
112
|
+
.then(ref(rules, "combined_suffixes").maybe())
|
|
113
|
+
.then(ref(rules, "series_word").maybe())
|
|
114
|
+
.then(ref(rules, "attachment").maybe())
|
|
115
|
+
.then(ref(rules, "version_part").maybe())
|
|
116
|
+
.then(ref(rules, "document_date").maybe()));
|
|
117
|
+
rule("base_without_series", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
118
|
+
.then(ref(rules, "code"))
|
|
119
|
+
.then(ref(rules, "code_suffixes"))
|
|
120
|
+
.then(ref(rules, "attachment").maybe())
|
|
121
|
+
.then(ref(rules, "version_part").maybe())
|
|
122
|
+
.then(ref(rules, "document_date").maybe()));
|
|
123
|
+
rule("series_code_body", () => str("OB").then(dash).absent()
|
|
124
|
+
.then(upper.repeat(2, 2).as("series"))
|
|
125
|
+
.then(dash.as("series_dash"))
|
|
126
|
+
.then(digits.or(upper).as("number"))
|
|
127
|
+
.then(ref(rules, "parts")));
|
|
128
|
+
rule("contribution", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
129
|
+
.then(ref(rules, "series"))
|
|
130
|
+
.then(str("-C").as("contribution_marker"))
|
|
131
|
+
.then(ref(rules, "number"))
|
|
132
|
+
.then(ref(rules, "parts"))
|
|
133
|
+
.then(ref(rules, "language").maybe()));
|
|
134
|
+
rule("base_series_code", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
135
|
+
.then(ref(rules, "series_code_body"))
|
|
136
|
+
.then(ref(rules, "version_part").maybe())
|
|
137
|
+
.then(ref(rules, "document_date").maybe()));
|
|
138
|
+
rule("series_code_identifier", () => ref(rules, "base_series_code").then(ref(rules, "language").maybe()));
|
|
139
|
+
rule("report_word", () => str("Report").as("report_marker"));
|
|
140
|
+
rule("report_body", () => str("OB").then(dot).absent()
|
|
141
|
+
.then(ref(rules, "series").then(dot).maybe())
|
|
142
|
+
.then(ref(rules, "code"))
|
|
143
|
+
.then(ref(rules, "range_end").maybe())
|
|
144
|
+
.then(ref(rules, "code_suffixes"))
|
|
145
|
+
.then(ref(rules, "series_word").maybe())
|
|
146
|
+
.then(ref(rules, "attachment").maybe())
|
|
147
|
+
.then(ref(rules, "version_part").maybe())
|
|
148
|
+
.then(ref(rules, "document_date").maybe()));
|
|
149
|
+
rule("base_report", () => ref(rules, "report_word").then(space, ref(rules, "itu_prefix"), ref(rules, "sector"), space, ref(rules, "report_body"))
|
|
150
|
+
.or(ref(rules, "itu_prefix").then(ref(rules, "sector"), space, ref(rules, "report_word"), space, ref(rules, "report_body"))));
|
|
151
|
+
rule("report_identifier", () => ref(rules, "base_report").then(ref(rules, "language").maybe()));
|
|
152
|
+
rule("resolution_word", () => str("Resolution").or(str("Res.")).as("resolution_marker"));
|
|
153
|
+
rule("resolution_body", () => ref(rules, "code").then(ref(rules, "document_date").maybe()));
|
|
154
|
+
rule("base_resolution", () => ref(rules, "resolution_word").then(space, ref(rules, "itu_prefix"), ref(rules, "sector"), space, ref(rules, "resolution_body"))
|
|
155
|
+
.or(ref(rules, "itu_prefix").then(ref(rules, "sector"), space, ref(rules, "resolution_word"), space, ref(rules, "resolution_body"))));
|
|
156
|
+
rule("resolution_identifier", () => ref(rules, "base_resolution").then(ref(rules, "language").maybe()));
|
|
157
|
+
rule("base", () => ref(rules, "base_report")
|
|
158
|
+
.or(ref(rules, "base_with_series"))
|
|
159
|
+
.or(ref(rules, "base_without_series"))
|
|
160
|
+
.or(ref(rules, "base_series_code")));
|
|
161
|
+
rule("annex_body", () => ref(rules, "base").as("base")
|
|
162
|
+
.then(space, str("Annex"), space, upper.then(digits.maybe(), str("+").maybe()).as("annex_number"))
|
|
163
|
+
.then(ref(rules, "document_date").maybe()));
|
|
164
|
+
rule("annex_identifier", () => ref(rules, "annex_body").then(ref(rules, "language").maybe()));
|
|
165
|
+
rule("appendix_material", () => space.then(str("test vectors").or(str("Software")).as("appendix_material")));
|
|
166
|
+
rule("appendix_body", () => ref(rules, "base").as("base")
|
|
167
|
+
.then(space, str("App."), space.maybe())
|
|
168
|
+
.then(match("[IVX]").repeat(1, Infinity).as("appendix_number"))
|
|
169
|
+
.then(ref(rules, "appendix_material").maybe())
|
|
170
|
+
.then(ref(rules, "document_date").maybe()));
|
|
171
|
+
rule("appendix_identifier", () => ref(rules, "appendix_body").then(ref(rules, "language").maybe()));
|
|
172
|
+
rule("supplement_with_base", () => ref(rules, "annex_body").as("base")
|
|
173
|
+
.or(ref(rules, "appendix_body").as("base"))
|
|
174
|
+
.or(ref(rules, "base").as("base"))
|
|
175
|
+
.then(space, ref(rules, "supplement_type"))
|
|
176
|
+
.then(ref(rules, "supplement_number"))
|
|
177
|
+
.then(ref(rules, "supplement_date").maybe())
|
|
178
|
+
.then(ref(rules, "language").maybe()));
|
|
179
|
+
rule("supplement_series_only", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
180
|
+
.then(ref(rules, "series_group").or(ref(rules, "series")))
|
|
181
|
+
.then(ref(rules, "series_word").maybe())
|
|
182
|
+
.then(space, ref(rules, "supplement_type"))
|
|
183
|
+
.then(ref(rules, "supplement_number"))
|
|
184
|
+
.then(ref(rules, "supplement_date").maybe())
|
|
185
|
+
.then(ref(rules, "language").maybe()));
|
|
186
|
+
rule("chained_supplement", () => ref(rules, "supplement_with_base").as("base").or(ref(rules, "supplement_series_only").as("base"))
|
|
187
|
+
.then(space, ref(rules, "supplement_type"))
|
|
188
|
+
.then(ref(rules, "supplement_number"))
|
|
189
|
+
.then(ref(rules, "supplement_date").maybe())
|
|
190
|
+
.then(ref(rules, "language").maybe()));
|
|
191
|
+
rule("slash_chained_supplement", () => ref(rules, "supplement_with_base").as("base")
|
|
192
|
+
.then(str("/").as("supplement_slash"))
|
|
193
|
+
.then(ref(rules, "supplement_type"))
|
|
194
|
+
.then(ref(rules, "supplement_number"))
|
|
195
|
+
.then(ref(rules, "supplement_date").maybe())
|
|
196
|
+
.then(ref(rules, "language").maybe()));
|
|
197
|
+
rule("supplement_identifier", () => ref(rules, "chained_supplement")
|
|
198
|
+
.or(ref(rules, "slash_chained_supplement"))
|
|
199
|
+
.or(ref(rules, "supplement_with_base"))
|
|
200
|
+
.or(ref(rules, "supplement_series_only")));
|
|
201
|
+
rule("with_series", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
202
|
+
.then(ref(rules, "rec_word").maybe())
|
|
203
|
+
.then(ref(rules, "series"), dot, ref(rules, "code"))
|
|
204
|
+
.then(ref(rules, "range_end").maybe())
|
|
205
|
+
.then(ref(rules, "code_suffixes"))
|
|
206
|
+
.then(ref(rules, "combined_suffixes").maybe())
|
|
207
|
+
.then(ref(rules, "series_word").maybe())
|
|
208
|
+
.then(ref(rules, "attachment").maybe())
|
|
209
|
+
.then(ref(rules, "version_part").maybe())
|
|
210
|
+
.then(ref(rules, "document_date").maybe())
|
|
211
|
+
.then(ref(rules, "language").maybe()));
|
|
212
|
+
rule("without_series", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
213
|
+
.then(ref(rules, "code"))
|
|
214
|
+
.then(ref(rules, "code_suffixes"))
|
|
215
|
+
.then(ref(rules, "attachment").maybe())
|
|
216
|
+
.then(ref(rules, "version_part").maybe())
|
|
217
|
+
.then(ref(rules, "document_date").maybe())
|
|
218
|
+
.then(ref(rules, "language").maybe()));
|
|
219
|
+
rule("ob_roman_date", () => str(" - ").then(digit.repeat(2, 2).as("day"), dot, str("XII").or(str("XI")).or(str("IX")).or(str("VIII")).or(str("VII")).or(str("VI"))
|
|
220
|
+
.or(str("V")).or(str("IV")).or(str("III")).or(str("II")).or(str("I")).as("roman_month"), dot, digit.repeat(4, 4).as("year")));
|
|
221
|
+
rule("ob_date", () => ref(rules, "date_part").or(ref(rules, "ob_roman_date")));
|
|
222
|
+
rule("ob_series", () => str("OB").as("series"));
|
|
223
|
+
rule("ob_dot_body", () => dot.then(ref(rules, "number")));
|
|
224
|
+
rule("ob_no_body", () => space.then(str("No."), space, ref(rules, "number")));
|
|
225
|
+
rule("ob_bare_body", () => space.then(ref(rules, "number")));
|
|
226
|
+
rule("ob_with_sector", () => ref(rules, "itu_prefix")
|
|
227
|
+
.then(ref(rules, "sector").then(space).maybe())
|
|
228
|
+
.then(ref(rules, "ob_series"))
|
|
229
|
+
.then(ref(rules, "ob_dot_body").or(ref(rules, "ob_no_body")).or(ref(rules, "ob_bare_body")))
|
|
230
|
+
.then(ref(rules, "ob_date").maybe())
|
|
231
|
+
.then(ref(rules, "language").maybe()));
|
|
232
|
+
rule("ob_long_form", () => ref(rules, "itu_prefix")
|
|
233
|
+
.then(ref(rules, "sector").then(space).maybe())
|
|
234
|
+
.then(str("Operational Bulletin").as("_op_bull"))
|
|
235
|
+
.then(space, str("No."), space, ref(rules, "number"))
|
|
236
|
+
.then(ref(rules, "document_date").maybe())
|
|
237
|
+
.then(ref(rules, "language").maybe()));
|
|
238
|
+
rule("special_publication", () => ref(rules, "ob_with_sector").or(ref(rules, "ob_long_form")));
|
|
239
|
+
rule("annex_to_identifier", () => str("Annex to").then(space, ref(rules, "special_publication").as("annex_to")));
|
|
240
|
+
rule("handbook", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
241
|
+
.then(ref(rules, "number"), dot, str("HDB").as("handbook_marker"))
|
|
242
|
+
.then(ref(rules, "document_date").maybe()));
|
|
243
|
+
rule("numeric_question", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
244
|
+
.then(ref(rules, "number"), ref(rules, "parts"))
|
|
245
|
+
.then(str("/").then(digits.as("study_group")))
|
|
246
|
+
.then(str(":").as("question_colon").maybe()));
|
|
247
|
+
rule("question_tail", () => ref(rules, "number")
|
|
248
|
+
.then(str("/BL").as("has_bl").maybe())
|
|
249
|
+
.then(str("/"), digits.as("study_group")));
|
|
250
|
+
rule("letter_question", () => ref(rules, "itu_prefix").then(ref(rules, "sector"), space)
|
|
251
|
+
.then(ref(rules, "series"), dot)
|
|
252
|
+
.then(str("[").as("bracketed").then(ref(rules, "question_tail"), str("]"))
|
|
253
|
+
.or(ref(rules, "question_tail")))
|
|
254
|
+
.then(str(":").as("question_colon").maybe()));
|
|
255
|
+
rule("common_text_twin", () => space.then(str("|"), space, match("[^-|]").repeat(1, Infinity)).as("common_text_twin"));
|
|
256
|
+
rule("radio_regulations", () => ref(rules, "itu_prefix")
|
|
257
|
+
.then(str("R").as("sector"))
|
|
258
|
+
.then(space, str("RR").as("radio_regulations"))
|
|
259
|
+
.then(ref(rules, "date_part").or(dash.then(digit.repeat(4, 4).as("year"))).maybe())
|
|
260
|
+
.then(ref(rules, "language").maybe())
|
|
261
|
+
.then(match("[-F]").absent()));
|
|
262
|
+
rule("document_date", () => ref(rules, "date_part").or(ref(rules, "id_date")));
|
|
263
|
+
rule("itu_identifier", () => ref(rules, "annex_to_identifier")
|
|
264
|
+
.or(ref(rules, "special_publication"))
|
|
265
|
+
.or(ref(rules, "supplement_identifier"))
|
|
266
|
+
.or(ref(rules, "annex_identifier"))
|
|
267
|
+
.or(ref(rules, "appendix_identifier"))
|
|
268
|
+
.or(ref(rules, "report_identifier"))
|
|
269
|
+
.or(ref(rules, "resolution_identifier"))
|
|
270
|
+
.or(ref(rules, "handbook"))
|
|
271
|
+
.or(ref(rules, "numeric_question"))
|
|
272
|
+
.or(ref(rules, "letter_question"))
|
|
273
|
+
.or(ref(rules, "radio_regulations"))
|
|
274
|
+
.or(ref(rules, "with_series"))
|
|
275
|
+
.or(ref(rules, "contribution"))
|
|
276
|
+
.or(ref(rules, "series_code_identifier"))
|
|
277
|
+
.or(ref(rules, "without_series"))
|
|
278
|
+
.or(ref(rules, "publication_id")));
|
|
279
|
+
rule("publication_id", () => ref(rules, "sector").then(dash, str("REC"), dash, ref(rules, "series"), dot, ref(rules, "code"))
|
|
280
|
+
.then(ref(rules, "yyyymm_date"))
|
|
281
|
+
.then(ref(rules, "id_status").maybe())
|
|
282
|
+
.then(ref(rules, "language").maybe()));
|
|
283
|
+
rule("common_text_identifier", () => ref(rules, "itu_identifier").then(ref(rules, "common_text_twin")));
|
|
284
|
+
rule("identifier", () => ref(rules, "common_text_identifier").or(ref(rules, "itu_identifier")));
|
|
285
|
+
return rules;
|
|
286
|
+
}
|
|
287
|
+
export const ituWorkerGrammar = {
|
|
288
|
+
rules: buildRules(),
|
|
289
|
+
root: "identifier",
|
|
290
|
+
};
|
|
291
|
+
/** The worker engine as a substrate runtime: parse only (the artifact's
|
|
292
|
+
* other services — materialize/render/derive/tests — stay engine-side). */
|
|
293
|
+
export function ituWorkerRuntime() {
|
|
294
|
+
return {
|
|
295
|
+
parseAndBind(input) {
|
|
296
|
+
try {
|
|
297
|
+
return parseGrammar(ituWorkerGrammar, input);
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
if (err instanceof ParseFailed)
|
|
301
|
+
return null;
|
|
302
|
+
throw err;
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
};
|
|
306
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TreeObject } from "../../grammar/engine.js";
|
|
2
|
+
import type { FlavorImplementation } from "../../conformance/implementation.js";
|
|
3
|
+
/** The parse-tree normalization peel (parser.rb normalize_input): a
|
|
4
|
+
* judgment about inputs, not a fact about the grammar — it stays
|
|
5
|
+
* hand-side ahead of the injected wire. */
|
|
6
|
+
export declare function normalizeWhitespaceItu(input: string): string;
|
|
7
|
+
/** The bound -> wire lane is injected so the node entry (the generated
|
|
8
|
+
* substrate over the wasm artifact runtime) and the worker entry (the
|
|
9
|
+
* pure-TS worker engine) share this delta byte for byte. */
|
|
10
|
+
export declare function makeItuGrammarImplementation(parseWire: (body: string) => TreeObject): FlavorImplementation;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
//! The itu semantic delta over the generated substrate
|
|
2
|
+
//! (pubid/pubid-grammar#164): the builder (the exact dispatch order the
|
|
3
|
+
//! reference pins) and the input normalization peel. Pure — no
|
|
4
|
+
//! `node:*` module, no engine import — so both entries (the node barrel
|
|
5
|
+
//! over the wasm artifact runtime, the worker entry over the pure-TS
|
|
6
|
+
//! worker engine) run the same delta.
|
|
7
|
+
//!
|
|
8
|
+
//! The parse function is injected: the entry binds it to
|
|
9
|
+
//! `substrate.boundToWire(substrate.parseBound(body))` (node) or the
|
|
10
|
+
//! worker engine's equivalent (worker), both producing the artifact's
|
|
11
|
+
//! declared wire shape. The combined-designation tail reads the
|
|
12
|
+
//! artifact's d_* captures (the designation depth pairs into its own
|
|
13
|
+
//! capture names so the primary's Code is never corrupted by the
|
|
14
|
+
//! designation's tail).
|
|
15
|
+
import { ParseFailed } from "../../grammar/engine.js";
|
|
16
|
+
import { PubidDate } from "../../model/component.js";
|
|
17
|
+
import { ITU_CLASSES, ITU_LANGUAGES, ItuCode, ItuDesignation, ItuSpecialPublication, } from "./model.js";
|
|
18
|
+
/**
|
|
19
|
+
* Port of lib/pubid/itu/builder.rb — the exact dispatch order:
|
|
20
|
+
* annex_to → annex_number → appendix_number → OB/_op_bull →
|
|
21
|
+
* supplement_type → handbook_marker → study_group → contribution →
|
|
22
|
+
* combined → report/recommendation.
|
|
23
|
+
*/
|
|
24
|
+
const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
25
|
+
const s = (v) => v === undefined || v === null ? undefined : String(v);
|
|
26
|
+
function flatten(data) {
|
|
27
|
+
return Array.isArray(data) ? Object.assign({}, ...data) : data;
|
|
28
|
+
}
|
|
29
|
+
function extractParts(raw) {
|
|
30
|
+
if (Array.isArray(raw)) {
|
|
31
|
+
return raw.map((p) => (isObj(p) ? String(p["part"]) : String(p)));
|
|
32
|
+
}
|
|
33
|
+
if (isObj(raw) && raw["part"] !== undefined)
|
|
34
|
+
return [String(raw["part"])];
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const normLanguage = (v) => {
|
|
38
|
+
const raw = s(v);
|
|
39
|
+
if (raw === undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
return ITU_LANGUAGES[raw] ?? raw;
|
|
42
|
+
};
|
|
43
|
+
class ItuBuilder {
|
|
44
|
+
build(data) {
|
|
45
|
+
const tree = flatten(data);
|
|
46
|
+
// The common-text twin ("| ISO/IEC …") is stored as the stripped
|
|
47
|
+
// string (Ruby parses it cross-flavor; no ISO parser exists in the
|
|
48
|
+
// TS mirror yet, and no corpus row carries one).
|
|
49
|
+
const twinRaw = s(tree["common_text_twin"])?.replace(/^\s*\|\s*/, "");
|
|
50
|
+
const twin = twinRaw === "" ? undefined : twinRaw;
|
|
51
|
+
if (tree["annex_to"] !== undefined)
|
|
52
|
+
return this.buildAnnexTo(tree["annex_to"]);
|
|
53
|
+
// The supplement check comes BEFORE the annex/appendix branches (the
|
|
54
|
+
// reference's own order): the bound map collects every capture
|
|
55
|
+
// occurrence by name across the tree, so a supplement whose base is
|
|
56
|
+
// an annex ("... Annex B (1996) Cor. 3 (03/2001)") hoists the nested
|
|
57
|
+
// annex_number to the top level, and an annex-first dispatch would
|
|
58
|
+
// build the annex and drop the supplement. The nested annex/appendix
|
|
59
|
+
// data stays intact inside the raw base subtree and is picked up by
|
|
60
|
+
// the recursive build below.
|
|
61
|
+
if (tree["supplement_type"] !== undefined) {
|
|
62
|
+
return this.withTwin(this.buildSupplement(tree), twin);
|
|
63
|
+
}
|
|
64
|
+
if (tree["annex_number"] !== undefined) {
|
|
65
|
+
return this.withTwin(this.buildAnnexOfRecommendation(tree), twin);
|
|
66
|
+
}
|
|
67
|
+
if (tree["appendix_number"] !== undefined) {
|
|
68
|
+
return this.withTwin(this.buildAppendixOfRecommendation(tree), twin);
|
|
69
|
+
}
|
|
70
|
+
if (tree["radio_regulations"] !== undefined) {
|
|
71
|
+
return this.withTwin(this.buildRadioRegulations(tree), twin);
|
|
72
|
+
}
|
|
73
|
+
if ((s(tree["series"]) === "OB" && tree["series_dash"] === undefined) || tree["_op_bull"] !== undefined) {
|
|
74
|
+
return this.withTwin(this.buildSpecialPublication(tree), twin);
|
|
75
|
+
}
|
|
76
|
+
if (tree["handbook_marker"] !== undefined)
|
|
77
|
+
return this.buildHandbook(tree);
|
|
78
|
+
if (tree["study_group"] !== undefined)
|
|
79
|
+
return this.buildQuestion(tree);
|
|
80
|
+
if (tree["contribution_marker"] !== undefined)
|
|
81
|
+
return this.buildContribution(tree);
|
|
82
|
+
const code = tree["number"] !== undefined ? this.buildCode(tree) : undefined;
|
|
83
|
+
const date = tree["year"] !== undefined ? this.buildDate(tree) : undefined;
|
|
84
|
+
const common = {
|
|
85
|
+
sector: s(tree["sector"]),
|
|
86
|
+
series: s(tree["series"]),
|
|
87
|
+
code,
|
|
88
|
+
date,
|
|
89
|
+
version: s(tree["version"]),
|
|
90
|
+
series_word: tree["series_word"] !== undefined,
|
|
91
|
+
series_dash: tree["series_dash"] !== undefined,
|
|
92
|
+
attachment: tree["attachment"] !== undefined,
|
|
93
|
+
range_end: s(tree["range_end"]),
|
|
94
|
+
language: normLanguage(tree["language"]),
|
|
95
|
+
common_text_twin: twin,
|
|
96
|
+
};
|
|
97
|
+
if (tree["combined"] !== undefined) {
|
|
98
|
+
return new ITU_CLASSES["combined"]({
|
|
99
|
+
...common,
|
|
100
|
+
combined: this.buildDesignations(tree["combined"]),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const klass = tree["report_marker"] !== undefined
|
|
104
|
+
? ITU_CLASSES["report"]
|
|
105
|
+
: tree["resolution_marker"] !== undefined
|
|
106
|
+
? ITU_CLASSES["resolution"]
|
|
107
|
+
: ITU_CLASSES["recommendation"];
|
|
108
|
+
return new klass({ ...common });
|
|
109
|
+
}
|
|
110
|
+
withTwin(identifier, twin) {
|
|
111
|
+
if (twin !== undefined) {
|
|
112
|
+
identifier["common_text_twin"] = twin;
|
|
113
|
+
}
|
|
114
|
+
return identifier;
|
|
115
|
+
}
|
|
116
|
+
buildCode(tree) {
|
|
117
|
+
return new ItuCode({
|
|
118
|
+
imp_marker: s(tree["imp_marker"]),
|
|
119
|
+
number: s(tree["number"]),
|
|
120
|
+
series_suffix: s(tree["series_suffix"]),
|
|
121
|
+
series_suffix_spaced: tree["series_suffix_spaced"] !== undefined,
|
|
122
|
+
subseries: s(tree["subseries"]),
|
|
123
|
+
parts: extractParts(tree["parts"]),
|
|
124
|
+
qualifier: s(tree["qualifier"]),
|
|
125
|
+
qualifier_glued: tree["qualifier"] !== undefined && tree["qualifier_spaced"] === undefined,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
buildDate(tree) {
|
|
129
|
+
// The Roman month of a bulletin date ("15.III.2016") is stored as the
|
|
130
|
+
// two-digit month every other ITU date uses; the day marks the spelling.
|
|
131
|
+
const roman = s(tree["roman_month"]);
|
|
132
|
+
const month = roman !== undefined
|
|
133
|
+
? (ItuSpecialPublication.ROMAN_MONTHS.indexOf(roman) + 1).toString().padStart(2, "0")
|
|
134
|
+
: s(tree["month"]);
|
|
135
|
+
return new PubidDate({ year: s(tree["year"]), month, day: s(tree["day"]) });
|
|
136
|
+
}
|
|
137
|
+
/** OB keeps the sector of the TSB spelling ("ITU-T OB.1096") — it is a
|
|
138
|
+
* spelling, not identity (ItuSpecialPublication ignores it in ==). */
|
|
139
|
+
buildSpecialPublication(tree) {
|
|
140
|
+
return new ITU_CLASSES["special_publication"]({
|
|
141
|
+
sector: s(tree["sector"]),
|
|
142
|
+
series: "OB",
|
|
143
|
+
code: tree["number"] !== undefined ? this.buildCode(tree) : undefined,
|
|
144
|
+
date: tree["year"] !== undefined ? this.buildDate(tree) : undefined,
|
|
145
|
+
language: normLanguage(tree["language"]),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/** "ITU-R RR (2020)" — the series carries the whole designation. */
|
|
149
|
+
buildRadioRegulations(tree) {
|
|
150
|
+
return new ITU_CLASSES["radio_regulations"]({
|
|
151
|
+
sector: s(tree["sector"]),
|
|
152
|
+
series: "RR",
|
|
153
|
+
date: tree["year"] !== undefined ? this.buildDate(tree) : undefined,
|
|
154
|
+
language: normLanguage(tree["language"]),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
buildAnnexTo(inner) {
|
|
158
|
+
const data = flatten(inner);
|
|
159
|
+
const base = this.buildSpecialPublication(data);
|
|
160
|
+
return new ITU_CLASSES["annex_to"]({
|
|
161
|
+
base,
|
|
162
|
+
language: normLanguage(data["language"]),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** sector/series/code are deliberately NOT copied from the base. */
|
|
166
|
+
buildAnnexOfRecommendation(tree) {
|
|
167
|
+
return new ITU_CLASSES["annex_of"]({
|
|
168
|
+
base: this.build(tree["base"]),
|
|
169
|
+
number: s(tree["annex_number"]),
|
|
170
|
+
date: tree["year"] !== undefined ? this.buildDate(tree) : undefined,
|
|
171
|
+
language: normLanguage(tree["language"]),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
buildAppendixOfRecommendation(tree) {
|
|
175
|
+
return new ITU_CLASSES["appendix_of"]({
|
|
176
|
+
base: this.build(tree["base"]),
|
|
177
|
+
number: s(tree["appendix_number"]),
|
|
178
|
+
material: s(tree["appendix_material"]),
|
|
179
|
+
date: tree["year"] !== undefined ? this.buildDate(tree) : undefined,
|
|
180
|
+
language: normLanguage(tree["language"]),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
buildHandbook(tree) {
|
|
184
|
+
return new ITU_CLASSES["handbook"]({
|
|
185
|
+
sector: s(tree["sector"]),
|
|
186
|
+
code: this.buildCode(tree),
|
|
187
|
+
date: tree["year"] !== undefined ? this.buildDate(tree) : undefined,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
buildQuestion(tree) {
|
|
191
|
+
return new ITU_CLASSES["question"]({
|
|
192
|
+
sector: s(tree["sector"]),
|
|
193
|
+
series: s(tree["series"]),
|
|
194
|
+
code: this.buildCode(tree),
|
|
195
|
+
study_group: s(tree["study_group"]),
|
|
196
|
+
has_bl: tree["has_bl"] !== undefined,
|
|
197
|
+
bracketed: tree["bracketed"] !== undefined,
|
|
198
|
+
has_colon: tree["question_colon"] !== undefined,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
buildContribution(tree) {
|
|
202
|
+
return new ITU_CLASSES["contribution"]({
|
|
203
|
+
sector: s(tree["sector"]),
|
|
204
|
+
series: s(tree["series"]),
|
|
205
|
+
code: this.buildCode(tree),
|
|
206
|
+
language: normLanguage(tree["language"]),
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
buildDesignations(combined) {
|
|
210
|
+
const list = Array.isArray(combined) ? combined : [combined];
|
|
211
|
+
return list.map((element) => {
|
|
212
|
+
const d = isObj(element) && element["designation"] !== undefined ? flatten(element["designation"]) : isObj(element) ? element : {};
|
|
213
|
+
// The designation depth pairs its code-suffix shapes under the
|
|
214
|
+
// d_* capture names (the artifact's binding law: a capture name at
|
|
215
|
+
// two structural depths would corrupt the primary's Code); the
|
|
216
|
+
// d_parts elements carry their dash under d_part.
|
|
217
|
+
const parts = Array.isArray(d["d_parts"])
|
|
218
|
+
? d["d_parts"].map((p) => (isObj(p) ? String(p["d_part"]) : String(p)))
|
|
219
|
+
: [];
|
|
220
|
+
return new ItuDesignation({
|
|
221
|
+
series: s(d["series"]),
|
|
222
|
+
code: new ItuCode({
|
|
223
|
+
number: s(d["d_number"]),
|
|
224
|
+
series_suffix: s(d["d_series_suffix"]),
|
|
225
|
+
series_suffix_spaced: d["d_series_suffix_spaced"] !== undefined,
|
|
226
|
+
subseries: s(d["d_subseries"]),
|
|
227
|
+
parts,
|
|
228
|
+
qualifier: s(d["d_qualifier"]),
|
|
229
|
+
qualifier_glued: d["d_qualifier"] !== undefined && d["d_qualifier_spaced"] === undefined,
|
|
230
|
+
}),
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
buildSupplement(tree) {
|
|
235
|
+
const base = tree["base"] !== undefined ? this.build(tree["base"]) : undefined;
|
|
236
|
+
const token = (s(tree["supplement_type"]) ?? "").replace(".", "");
|
|
237
|
+
const kind = { Amd: "amendment", Add: "addendum", Cor: "corrigendum", Err: "errata", Suppl: "supplement" }[token];
|
|
238
|
+
if (kind === undefined)
|
|
239
|
+
throw new ParseFailed(`ITU: unknown supplement type ${token}`, 0);
|
|
240
|
+
const date = tree["supplement_year"] !== undefined
|
|
241
|
+
? new PubidDate({ year: s(tree["supplement_year"]), month: s(tree["supplement_month"]) })
|
|
242
|
+
: undefined;
|
|
243
|
+
// An annex base keeps sector/series/code on ITS base — reach
|
|
244
|
+
// through it via root, or a supplement of an annex carries none.
|
|
245
|
+
const baseAsIdu = base;
|
|
246
|
+
const baseIdentity = baseAsIdu !== undefined ? (baseAsIdu.sector !== undefined ? baseAsIdu : baseAsIdu.root()) : undefined;
|
|
247
|
+
const attrs = {
|
|
248
|
+
sector: baseIdentity?.sector ?? s(tree["sector"]),
|
|
249
|
+
series: baseIdentity?.series ?? s(tree["series"]),
|
|
250
|
+
code: baseIdentity?.code,
|
|
251
|
+
base,
|
|
252
|
+
number: s(tree["supplement_number"]),
|
|
253
|
+
// The captured space marks the SPACED ordinal; absence = glued.
|
|
254
|
+
number_glued: tree["supplement_space"] === undefined,
|
|
255
|
+
slash_joined: tree["supplement_slash"] !== undefined,
|
|
256
|
+
date,
|
|
257
|
+
language: normLanguage(tree["language"]),
|
|
258
|
+
series_word: base !== undefined ? baseIdentity?.series_word === true : tree["series_word"] !== undefined,
|
|
259
|
+
};
|
|
260
|
+
if (tree["technical"] !== undefined && kind === "corrigendum")
|
|
261
|
+
attrs["technical"] = true;
|
|
262
|
+
return new ITU_CLASSES[kind](attrs);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/** The parse-tree normalization peel (parser.rb normalize_input): a
|
|
266
|
+
* judgment about inputs, not a fact about the grammar — it stays
|
|
267
|
+
* hand-side ahead of the injected wire. */
|
|
268
|
+
export function normalizeWhitespaceItu(input) {
|
|
269
|
+
return input.replace(/\s+/g, " ").trim();
|
|
270
|
+
}
|
|
271
|
+
/** The bound -> wire lane is injected so the node entry (the generated
|
|
272
|
+
* substrate over the wasm artifact runtime) and the worker entry (the
|
|
273
|
+
* pure-TS worker engine) share this delta byte for byte. */
|
|
274
|
+
export function makeItuGrammarImplementation(parseWire) {
|
|
275
|
+
const builder = new ItuBuilder();
|
|
276
|
+
return {
|
|
277
|
+
parse(input) {
|
|
278
|
+
const tree = parseWire(normalizeWhitespaceItu(input));
|
|
279
|
+
if (typeof tree !== "object" || tree === null) {
|
|
280
|
+
throw new ParseFailed("ITU: unexpected parse tree", 0);
|
|
281
|
+
}
|
|
282
|
+
return builder.build(tree);
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|