@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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Grammar } from "../../grammar/engine.js";
|
|
2
|
-
/** The DAM-family ballot stage codes (grammar table
|
|
3
|
-
* typed_stages_ballots: PDAM, DAM, DAmd, FDAM, FDAmd, FPDAM — exactly
|
|
4
|
-
* these entries' abbrs); the TYPE-first ballot branch stays scoped to
|
|
5
|
-
* the ballot family. */
|
|
6
|
-
export declare const BALLOT_STAGE_CODES: string[];
|
|
7
|
-
export declare const isoGrammar: Grammar;
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import { match, ref, str } from "../../grammar/engine.js";
|
|
2
|
-
import { stageTokens } from "./model.js";
|
|
3
|
-
import { ISO_TYPED_STAGES } from "./stages.generated.js";
|
|
4
|
-
/**
|
|
5
|
-
* Port of lib/pubid/iso/parser.rb. The identifier alternation order is
|
|
6
|
-
* load-bearing (PEG ordered choice): nsb_iso | tc_document |
|
|
7
|
-
* directives | jcgm | iso_r_supplement | iso_r | suppl³ | suppl² |
|
|
8
|
-
* suppl | joint | copublishers. Stage tokens come from the typed-stage
|
|
9
|
-
* registry (longest first), split into base (non-supplement) and
|
|
10
|
-
* supplement tables exactly like the Ruby TYPED_STAGES constants.
|
|
11
|
-
*/
|
|
12
|
-
const SUPPLEMENT_TYPE_KEYS = ["amd", "cor", "suppl", "ext", "add"];
|
|
13
|
-
/** The DAM-family ballot stage codes (grammar table
|
|
14
|
-
* typed_stages_ballots: PDAM, DAM, DAmd, FDAM, FDAmd, FPDAM — exactly
|
|
15
|
-
* these entries' abbrs); the TYPE-first ballot branch stays scoped to
|
|
16
|
-
* the ballot family. */
|
|
17
|
-
export const BALLOT_STAGE_CODES = ["pdam", "damd", "fdamd", "fpdam"];
|
|
18
|
-
const BASE_STAGE_TOKENS = stageTokens().filter((t) => {
|
|
19
|
-
// Supplement tokens are excluded from the base table by type key, but
|
|
20
|
-
// stageTokens() is type-agnostic here; the split is done via the
|
|
21
|
-
// supplement table below (tokens unique to supplement types).
|
|
22
|
-
return true;
|
|
23
|
-
});
|
|
24
|
-
const DIRECTIVES_TOKENS = ["Directives Part", "Directives, Part", "Directives,", "Directives", "DIR"];
|
|
25
|
-
const DIRECTIVES_SUPPLEMENT_TOKENS = ["DIR SUP", "Supplement", "SUP"];
|
|
26
|
-
const ORGANIZATIONS = [
|
|
27
|
-
"ISO", "IEC", "IEEE", "CIW", "SAE", "CIE", "ASME", "ASTM", "OECD", "HL7", "CEI", "UNDP",
|
|
28
|
-
];
|
|
29
|
-
const TC_TYPES = [
|
|
30
|
-
"TC", "JTC", "PC", "IT", "CAB", "CASCO", "COPOLCO", "COUNCIL", "CPSG", "CS",
|
|
31
|
-
"DEVCO", "GA", "GAAB", "INFCO", "ITN", "ISOlutions", "REMCO", "TMB", "TMBG",
|
|
32
|
-
"WMO", "DMT", "JCG", "SGPM", "ATMG", "CCCC", "CCCC-TG", "JDMT", "JSAG",
|
|
33
|
-
"JSCTF-TF", "JTCG", "JTCG-TF", "SAG_Acc", "SAG_CRMI", "SAG_CRMI_CG",
|
|
34
|
-
"SAG_ESG", "SAG_ESG_CG", "SAG_MRS", "SAG_SF", "SAG_SF_CG", "SMCC", "STMG",
|
|
35
|
-
"MENA_STAR",
|
|
36
|
-
];
|
|
37
|
-
const WG_TYPES = [
|
|
38
|
-
"AG", "AhG", "WG", "JWG", "QC", "TF", "PPC", "CAG", "CSC", "ITSAG",
|
|
39
|
-
"CSC/FIN", "CSC/NOM", "CSC/OVE", "CSC/SP", "CSC", "SF", "ITSG", "JAG",
|
|
40
|
-
"JCTF", "JSG", "JTAG", "JTG",
|
|
41
|
-
];
|
|
42
|
-
function literalAlternation(tokens) {
|
|
43
|
-
const sorted = [...new Set(tokens)].sort((a, b) => b.length - a.length);
|
|
44
|
-
return sorted.map((t) => str(t)).reduce((a, b) => a.or(b));
|
|
45
|
-
}
|
|
46
|
-
function buildRules() {
|
|
47
|
-
const rules = {};
|
|
48
|
-
const rule = (name, build) => {
|
|
49
|
-
rules[name] = build();
|
|
50
|
-
};
|
|
51
|
-
const space = str(" ");
|
|
52
|
-
const digit = match("[0-9]");
|
|
53
|
-
const digits = digit.repeat(1, Infinity);
|
|
54
|
-
const yearDigits = digit.repeat(4, 4);
|
|
55
|
-
const monthDigits = digit.repeat(2, 2);
|
|
56
|
-
const dayDigits = digit.repeat(2, 2);
|
|
57
|
-
const dashChars = ["-", "‑", "‐"];
|
|
58
|
-
const dash = literalAlternation(dashChars);
|
|
59
|
-
rule("publisher", () => str("ISO").or(str("IEC")).as("publisher"));
|
|
60
|
-
rule("copublishers", () => str("/")
|
|
61
|
-
.then(space.maybe(), literalAlternation(ORGANIZATIONS).as("copublisher"))
|
|
62
|
-
.repeat(0, Infinity)
|
|
63
|
-
.as("copublishers"));
|
|
64
|
-
// (:|dash)(-- undated | Y[-M[-D]]), all optional after the separator.
|
|
65
|
-
rule("date", () => str(":")
|
|
66
|
-
.or(dash)
|
|
67
|
-
.then(str("--")
|
|
68
|
-
.or(str("—"))
|
|
69
|
-
.as("undated_marker")
|
|
70
|
-
.or(yearDigits
|
|
71
|
-
.then(dash.then(monthDigits).maybe(), dash.then(dayDigits).maybe())
|
|
72
|
-
.as("date"))
|
|
73
|
-
.maybe()));
|
|
74
|
-
rule("number", () => digit.repeat(1, 5));
|
|
75
|
-
// Modern "-A01", "-5-1-1" (space-tolerant) vs legacy "/6" (guarded
|
|
76
|
-
// against supplement type names).
|
|
77
|
-
rule("part_and_subpart", () => dash
|
|
78
|
-
.then(space.maybe(), match("\\w").repeat(1, Infinity), dash.then(match("\\w").repeat(1, Infinity)).repeat(0, Infinity).maybe())
|
|
79
|
-
.or(str("/").then(space.maybe(), ref(rules, "supplement_type_with_stage").absent(), match("\\w").repeat(1, Infinity))));
|
|
80
|
-
rule("number_with_part", () => rules["number"].then(rules["part_and_subpart"].maybe()).as("number_with_part"));
|
|
81
|
-
rule("all_parts", () => str("(all parts)").as("all_parts"));
|
|
82
|
-
const supplementTypeTokens = stageTokens(SUPPLEMENT_TYPE_KEYS);
|
|
83
|
-
const baseStageTokens = BASE_STAGE_TOKENS.filter((t) => !supplementTypeTokens.includes(t));
|
|
84
|
-
rule("type_with_stage", () => literalAlternation(baseStageTokens)
|
|
85
|
-
.as("type_with_stage")
|
|
86
|
-
.then(digit.as("stage_iteration").then(space).maybe()));
|
|
87
|
-
rule("supplement_type_with_stage", () => literalAlternation(supplementTypeTokens).as("type_with_stage"));
|
|
88
|
-
// (en,fr) or (E/F) — repeated captures joined.
|
|
89
|
-
rule("language", () => str("(").then(match("[a-z]")
|
|
90
|
-
.repeat(1, Infinity)
|
|
91
|
-
.then(str(",").maybe())
|
|
92
|
-
.or(match("[EFARDS]").then(str("/").or(str(",")).maybe()))
|
|
93
|
-
.repeat(0, Infinity)
|
|
94
|
-
.as("languages"), str(")")));
|
|
95
|
-
rule("edition", () => literalAlternation(["Edition", "Ed.", "ED", "Ed"])
|
|
96
|
-
.then(space.maybe(), digits.maybe())
|
|
97
|
-
.as("edition"));
|
|
98
|
-
rule("stage_iteration", () => str(".").then(digit.as("stage_iteration")));
|
|
99
|
-
rule("second_part", () => rules["number_with_part"]
|
|
100
|
-
.then(rules["stage_iteration"].maybe(), space.maybe(), rules["date"].maybe()));
|
|
101
|
-
rule("third_part_edition", () => space.maybe().then(rules["edition"].maybe()));
|
|
102
|
-
rule("third_part", () => rules["third_part_edition"]
|
|
103
|
-
.then(rules["language"].maybe(), space.maybe(), rules["all_parts"].maybe()));
|
|
104
|
-
rule("guide_prefix", () => str("Guide").or(str("GUIDE")));
|
|
105
|
-
rule("prefix_with_copublishers", () => str("ISO/R")
|
|
106
|
-
.as("iso_r_prefix")
|
|
107
|
-
.then(space)
|
|
108
|
-
.or(rules["publisher"]
|
|
109
|
-
.then(space.maybe(), rules["copublishers"].maybe())));
|
|
110
|
-
rule("identifier_copublishers_no_third", () => rules["guide_prefix"]
|
|
111
|
-
.as("type_with_stage_fr")
|
|
112
|
-
.then(space)
|
|
113
|
-
.maybe()
|
|
114
|
-
.then(rules["prefix_with_copublishers"].maybe(), space.maybe(), str("/").maybe(), rules["type_with_stage"].maybe(), space.maybe(), rules["second_part"], rules["third_part_edition"]));
|
|
115
|
-
rule("identifier_copublishers", () => rules["identifier_copublishers_no_third"].then(rules["third_part"]));
|
|
116
|
-
// NSB-prefixed: FprISO… / WD/ISO…
|
|
117
|
-
const nsbBody = () => rules["publisher"]
|
|
118
|
-
.then(space.maybe(), rules["copublishers"].maybe(), space.maybe(), rules["type_with_stage"].maybe(), space.maybe(), rules["second_part"], rules["third_part"]);
|
|
119
|
-
rule("nsb_iso_identifier", () => str("Fpr")
|
|
120
|
-
.as("nsb_stage")
|
|
121
|
-
.then(nsbBody())
|
|
122
|
-
.or(str("WD").as("nsb_stage").then(str("/"), nsbBody())));
|
|
123
|
-
// TC documents: ISO/TC 184/SC 4/WG 3 N 123[:year]
|
|
124
|
-
rule("tc_type", () => literalAlternation(TC_TYPES).as("tc_type"));
|
|
125
|
-
rule("sc_type", () => str("SC/QC").or(str("SC")).as("sc_type"));
|
|
126
|
-
rule("wg_type", () => literalAlternation(WG_TYPES).as("wg_type"));
|
|
127
|
-
// Bare TC reference (pubid-iso#285): "184/SC 4/WG 12 N10291" — the
|
|
128
|
-
// ISO/TC route without the ORIGINATOR prefix; the SC segment is
|
|
129
|
-
// required so bare numbers cannot leak into the route.
|
|
130
|
-
rule("bare_tc_document", () => digits.as("tc_number")
|
|
131
|
-
.then(str("/"), rules["sc_type"], space, digits.as("sc_number"))
|
|
132
|
-
.then(str("/"), rules["wg_type"], space, digits.as("wg_number")).maybe()
|
|
133
|
-
.then(space, str("N"), space.maybe(), digits.as("number"))
|
|
134
|
-
.then(str(":"), yearDigits.as("year")).maybe());
|
|
135
|
-
rule("tc_subcommittee_part", () => str("/")
|
|
136
|
-
.then(rules["sc_type"], space, digits.as("sc_number"), str("/"), rules["wg_type"], space, digits.as("wg_number"))
|
|
137
|
-
.or(str("/").then(rules["sc_type"], space, digits.as("sc_number"))));
|
|
138
|
-
rule("tc_document", () => rules["publisher"]
|
|
139
|
-
.then(str("/").or(space), rules["tc_type"], space, digits.as("tc_number"), rules["tc_subcommittee_part"].maybe(), space, str("N"), space.maybe(), digits.as("number"), str(":").then(yearDigits.as("year")).maybe()));
|
|
140
|
-
// JCGM 200:2008(F)
|
|
141
|
-
rule("jcgm_identifier", () => str("JCGM")
|
|
142
|
-
.as("publisher")
|
|
143
|
-
.then(space, rules["second_part"], rules["third_part"]));
|
|
144
|
-
// Legacy ISO/R forms.
|
|
145
|
-
rule("iso_r_second_part", () => rules["number_with_part"]
|
|
146
|
-
.then(rules["stage_iteration"].maybe(), space.maybe(), rules["date"].maybe()));
|
|
147
|
-
rule("iso_r_identifier", () => str("ISO/R")
|
|
148
|
-
.as("iso_r_prefix")
|
|
149
|
-
.then(space, rules["iso_r_second_part"], rules["third_part"]));
|
|
150
|
-
rule("iso_r_supplement_separator", () => str("/").or(space.maybe().then(str("—"), space.maybe()), space.then(str("-"), space)));
|
|
151
|
-
rule("iso_r_supplement_identifier", () => str("ISO/R")
|
|
152
|
-
.as("iso_r_prefix")
|
|
153
|
-
.then(space, rules["iso_r_second_part"])
|
|
154
|
-
.as("base")
|
|
155
|
-
.then(rules["iso_r_supplement_separator"], rules["supplement_type_with_stage"], space.maybe(), rules["second_part"], rules["third_part"]));
|
|
156
|
-
// Supplements: base + "/" + stage + (second_part | .N | date)? [+ third]
|
|
157
|
-
rule("supplement_identifier_no_third", () => rules["identifier_copublishers_no_third"]
|
|
158
|
-
.as("base")
|
|
159
|
-
.then(str("/"), rules["supplement_type_with_stage"], space
|
|
160
|
-
.maybe()
|
|
161
|
-
.then(rules["second_part"])
|
|
162
|
-
.or(str(".").then(digits.as("number")), space.maybe().then(rules["date"]))
|
|
163
|
-
.maybe()));
|
|
164
|
-
rule("supplement_identifier", () => rules["supplement_identifier_no_third"].then(rules["third_part"]));
|
|
165
|
-
rule("supplement_supplement_identifier", () => rules["supplement_identifier_no_third"]
|
|
166
|
-
.as("base")
|
|
167
|
-
.then(str("/"), rules["supplement_type_with_stage"], space
|
|
168
|
-
.maybe()
|
|
169
|
-
.then(rules["second_part"], rules["third_part"])
|
|
170
|
-
.or(str(".").then(digits.as("number"), rules["third_part"]))));
|
|
171
|
-
rule("supplement_supplement_supplement_identifier", () => rules["supplement_supplement_identifier"]
|
|
172
|
-
.as("base")
|
|
173
|
-
.then(str("/"), rules["supplement_type_with_stage"], space
|
|
174
|
-
.maybe()
|
|
175
|
-
.then(rules["second_part"], rules["third_part"])
|
|
176
|
-
.or(str(".").then(digits.as("number"), rules["third_part"]))));
|
|
177
|
-
// Directives.
|
|
178
|
-
rule("directives_publisher_subgroup", () => str("JTC 1").as("subgroup"));
|
|
179
|
-
rule("directives_part_and_subpart", () => space.then(str("ISO").or(str("IEC")), str("/").absent(), space.then(str("SUP")).absent()));
|
|
180
|
-
rule("directives_number_with_part", () => rules["number"]
|
|
181
|
-
.then(rules["directives_part_and_subpart"].maybe())
|
|
182
|
-
.as("number_with_part"));
|
|
183
|
-
rule("directives_identifier_no_third", () => rules["prefix_with_copublishers"]
|
|
184
|
-
.then(space.maybe(), rules["directives_publisher_subgroup"].then(space).maybe(), literalAlternation(DIRECTIVES_TOKENS).as("type_with_stage"), space
|
|
185
|
-
.then(rules["directives_publisher_subgroup"], space.then(str("SUP")).absent())
|
|
186
|
-
.maybe(), space
|
|
187
|
-
.then(rules["directives_number_with_part"])
|
|
188
|
-
.maybe()
|
|
189
|
-
.then(str(":").then(rules["date"]).maybe())
|
|
190
|
-
.maybe()));
|
|
191
|
-
rule("directives_identifier", () => rules["directives_identifier_no_third"]
|
|
192
|
-
.then(rules["third_part"].maybe(), space.maybe(), rules["date"].maybe()));
|
|
193
|
-
rule("directives_supplement_part_no_third", () => space
|
|
194
|
-
.maybe()
|
|
195
|
-
.then(str("--"), space.maybe(), str("Consolidated"), space)
|
|
196
|
-
.maybe()
|
|
197
|
-
.then(str("ISO/IEC").or(str("ISO"), str("IEC"), str("JTC 1")).as("publisher"), space.then(literalAlternation(DIRECTIVES_SUPPLEMENT_TOKENS).as("type_with_stage")), rules["date"].maybe()));
|
|
198
|
-
rule("directives_supplement_part", () => rules["directives_supplement_part_no_third"].then(rules["third_part"].maybe()));
|
|
199
|
-
rule("directives_supplement_identifier", () => rules["directives_identifier_no_third"]
|
|
200
|
-
.as("base")
|
|
201
|
-
.then(space.maybe(), rules["directives_supplement_part"]));
|
|
202
|
-
rule("directives_bundled_identifier", () => rules["directives_identifier_no_third"]
|
|
203
|
-
.then(rules["third_part"].then(space.maybe()).maybe(), rules["date"].then(space.maybe()).maybe())
|
|
204
|
-
.as("base_document")
|
|
205
|
-
.then(str("+ ")
|
|
206
|
-
.then(rules["directives_supplement_part_no_third"].as("supplement"))
|
|
207
|
-
.repeat(1, Infinity)
|
|
208
|
-
.as("supplements")));
|
|
209
|
-
rule("directives_identifiers", () => rules["directives_bundled_identifier"].or(rules["directives_supplement_identifier"], rules["directives_identifier"]));
|
|
210
|
-
// Joint ISO|IDF — IDF side unreachable by the corpus (no rows); the
|
|
211
|
-
// twin is captured raw like ITU's common-text twin.
|
|
212
|
-
rule("idf_identifier", () => match("[^|]").repeat(1, Infinity).as("idf_raw"));
|
|
213
|
-
rule("joint_identifier", () => rules["identifier_copublishers_no_third"]
|
|
214
|
-
.as("base")
|
|
215
|
-
.then(space.maybe(), str("|"), space.maybe(), rules["idf_identifier"])
|
|
216
|
-
.as("joint_identifier"));
|
|
217
|
-
// Historic TYPE-first ballot faces (decode-to-modern, owner ruling
|
|
218
|
-
// 2026-11-12): the DAM-family token in TYPE position — "ISO/IEC FDAM 1
|
|
219
|
-
// 14496-12:2004", "ISO/PDAM 19973-2" — and the space-attached ballot
|
|
220
|
-
// face "ISO 15877-5:2009 FDAM 1". Both branches sit LAST in the
|
|
221
|
-
// identifier alternation, so they are purely additive: every face an
|
|
222
|
-
// earlier branch parses keeps its exact parse. The ballot token
|
|
223
|
-
// captures as ballot_type_with_stage; a number on the TYPE token is
|
|
224
|
-
// space-bounded (ballot_number) so "PDAM 19973-2" keeps 19973 in the
|
|
225
|
-
// base; an on-base stamp's number/date capture as ballot_stamp_* (the
|
|
226
|
-
// stamp token itself matches uncaptured — the ballot's stage comes
|
|
227
|
-
// from the TYPE token and the decode keeps no spelling). The builder
|
|
228
|
-
// folds the captures into ONE amendment layer over the whole base, the
|
|
229
|
-
// number taken from the TYPE token, the stamp, or the implied 1.
|
|
230
|
-
const ballotStageTokens = ISO_TYPED_STAGES
|
|
231
|
-
.filter((st) => BALLOT_STAGE_CODES.includes(st.code))
|
|
232
|
-
.flatMap((st) => st.abbr);
|
|
233
|
-
const ballotTypeAlt = literalAlternation(ballotStageTokens).as("ballot_type_with_stage");
|
|
234
|
-
rule("ballot_type_with_stage", () => ballotTypeAlt);
|
|
235
|
-
// An on-base stamp riding a ballot face ("/Amd 9:2001", "/Amd.1",
|
|
236
|
-
// "/Am1:2006"): it carries the amendment's number and ballot date
|
|
237
|
-
// while its own token letters are decode-away (matched uncaptured).
|
|
238
|
-
// The stamp's date captures under its own ballot_stamp_* names —
|
|
239
|
-
// reusing the base date capture would collide with second_part's at
|
|
240
|
-
// the sequence merge and the stamp's year would eat the base's.
|
|
241
|
-
rule("ballot_stamp", () => str("/")
|
|
242
|
-
.then(literalAlternation(supplementTypeTokens))
|
|
243
|
-
.then(space
|
|
244
|
-
.maybe()
|
|
245
|
-
.then(digit.repeat(1, 5).as("ballot_stamp_number"))
|
|
246
|
-
.then(str(":")
|
|
247
|
-
.or(dash)
|
|
248
|
-
.then(yearDigits
|
|
249
|
-
.then(dash.then(monthDigits).maybe(), dash.then(dayDigits).maybe())
|
|
250
|
-
.as("ballot_stamp_date"))
|
|
251
|
-
.or(str(":")
|
|
252
|
-
.or(dash)
|
|
253
|
-
.then(str("--").or(str("—")).as("ballot_stamp_undated_marker")))
|
|
254
|
-
.maybe())
|
|
255
|
-
.or(str(".").then(digits.as("ballot_stamp_dot_number")))));
|
|
256
|
-
// "ISO/IEC FDAM 1 14496-12:2004", "ISO/PDAM 19973-2": the ballot
|
|
257
|
-
// token first, then the base kept whole. The TYPE-token number is
|
|
258
|
-
// space-bounded on both sides — mandatory trailing space — so
|
|
259
|
-
// "PDAM 19973-2" cannot read 19973 as the ballot number: with no
|
|
260
|
-
// second space the group backtracks and 19973 parses in second_part.
|
|
261
|
-
rule("ballot_supplement_identifier", () => rules["prefix_with_copublishers"]
|
|
262
|
-
.then(space.maybe(), str("/").maybe(), ballotTypeAlt, space.then(digit.repeat(1, Infinity).as("ballot_number")).then(space).maybe(), space.maybe(), rules["type_with_stage"].maybe(), space.maybe(), rules["second_part"], rules["ballot_stamp"].maybe()));
|
|
263
|
-
// The space-attached ballot face: "ISO 15877-5:2009 FDAM 1" — the
|
|
264
|
-
// base designation first, then the ballot token attached by a space.
|
|
265
|
-
// The base front is inlined (not identifier_copublishers_no_third):
|
|
266
|
-
// that rule ends in third_part_edition, whose own optional space
|
|
267
|
-
// would consume the separator the ballot token needs. No base
|
|
268
|
-
// edition is served here — none of the stored or owner-cited ballot
|
|
269
|
-
// faces carries one.
|
|
270
|
-
rule("ballot_space_supplement_identifier", () => rules["guide_prefix"]
|
|
271
|
-
.as("type_with_stage_fr")
|
|
272
|
-
.then(space)
|
|
273
|
-
.maybe()
|
|
274
|
-
.then(rules["prefix_with_copublishers"].maybe(), space.maybe(), str("/").maybe(), rules["type_with_stage"].maybe(), space.maybe(), rules["second_part"], space, ballotTypeAlt, space.then(digit.repeat(1, Infinity).as("ballot_number")).maybe()));
|
|
275
|
-
rule("identifier", () => rules["bare_tc_document"].or(rules["nsb_iso_identifier"], rules["tc_document"], rules["directives_identifiers"], rules["jcgm_identifier"], rules["iso_r_supplement_identifier"], rules["iso_r_identifier"], rules["supplement_supplement_supplement_identifier"], rules["supplement_supplement_identifier"], rules["supplement_identifier"], rules["joint_identifier"], rules["identifier_copublishers"],
|
|
276
|
-
// The historic ballot faces go last — purely additive branches
|
|
277
|
-
// (an input an earlier member parses keeps that parse).
|
|
278
|
-
rules["ballot_supplement_identifier"], rules["ballot_space_supplement_identifier"]));
|
|
279
|
-
rule("root", () => rules["identifier"]);
|
|
280
|
-
return rules;
|
|
281
|
-
}
|
|
282
|
-
export const isoGrammar = { rules: buildRules(), root: "root" };
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { match, str } from "../../grammar/engine.js";
|
|
2
|
-
/**
|
|
3
|
-
* Port of lib/pubid/itu/parser.rb — the ITU grammar, 1:1 in dependency
|
|
4
|
-
* order. Load-bearing orderings (PEG ordered choice never re-enters a
|
|
5
|
-
* succeeded alternative, so neighbour order in `identifier` is pinned
|
|
6
|
-
* by the Ruby comments):
|
|
7
|
-
* annex_to | special_publication | supplement | annex | appendix |
|
|
8
|
-
* report | resolution | handbook | numeric_question | letter_question |
|
|
9
|
-
* with_series | contribution | series_code | without_series
|
|
10
|
-
* and supplement chains precede supplement_with_base (which would
|
|
11
|
-
* otherwise strand "/Technical Cor. 1" trailing input).
|
|
12
|
-
*/
|
|
13
|
-
function buildRules() {
|
|
14
|
-
const rules = {};
|
|
15
|
-
const rule = (name, build) => {
|
|
16
|
-
rules[name] = build();
|
|
17
|
-
};
|
|
18
|
-
const digit = match("[0-9]");
|
|
19
|
-
const digits = digit.repeat(1, Infinity);
|
|
20
|
-
const letter = match("[A-Z]");
|
|
21
|
-
const space = str(" ");
|
|
22
|
-
const dash = str("-");
|
|
23
|
-
const dot = str(".");
|
|
24
|
-
// ITU prefix — the optional "Recommendation " long form (issues #233/#234).
|
|
25
|
-
rule("itu_prefix", () => str("Recommendation ")
|
|
26
|
-
.then(str("ITU"), dash.or(space))
|
|
27
|
-
.or(str("ITU").then(dash.or(space))));
|
|
28
|
-
rule("sector", () => str("R").or(str("T"), str("D")).as("sector"));
|
|
29
|
-
// Study groups (SG1, SG12) or 1-3 letter series (BO, V, X).
|
|
30
|
-
rule("series", () => str("SG")
|
|
31
|
-
.then(digits)
|
|
32
|
-
.or(letter.repeat(1, 3))
|
|
33
|
-
.as("series"));
|
|
34
|
-
// A numeric series GROUP ("E-100", "G-100") — exactly one leading
|
|
35
|
-
// letter, or it would shadow series-code documents (EMC-5, IMPL-8).
|
|
36
|
-
rule("series_group", () => letter.then(digits.maybe(), dash, digits).as("series"));
|
|
37
|
-
rule("series_word", () => space.then(str("series").as("series_word")));
|
|
38
|
-
rule("number", () => digits.as("number"));
|
|
39
|
-
rule("subseries", () => dot.then(digits.as("subseries")));
|
|
40
|
-
// "quarter" is a real ITU misspelling kept verbatim so the two
|
|
41
|
-
// records stay distinct from their "quater" siblings.
|
|
42
|
-
const seriesSuffixWord = () => str("bis").or(str("ter"), str("quater"), str("quarter"));
|
|
43
|
-
// Glued edition suffix ("X.50bis", "V.8bis").
|
|
44
|
-
rule("series_suffix", () => seriesSuffixWord().as("series_suffix"));
|
|
45
|
-
// The spaced form ("E.250 bis") — the captured space IS the marker
|
|
46
|
-
// that sets series_suffix_spaced.
|
|
47
|
-
rule("series_suffix_spaced", () => space.as("series_suffix_spaced").then(seriesSuffixWord().as("series_suffix")));
|
|
48
|
-
// A single trailing variant letter ("D.200 R", glued "D.502R",
|
|
49
|
-
// lowercase "I.256.2a"). The A-R cap excludes "S" of " Suppl." and
|
|
50
|
-
// "V" of " V2"; the absent-guard stops it eating "Amd."/"Annex"/"Cor.".
|
|
51
|
-
rule("qualifier_letter", () => match("[A-R]")
|
|
52
|
-
.or(match("[a-r]"))
|
|
53
|
-
.as("qualifier")
|
|
54
|
-
.then(match("[A-Za-z0-9]").absent()));
|
|
55
|
-
rule("qualifier_glued", () => rules["qualifier_letter"]);
|
|
56
|
-
rule("qualifier_spaced", () => space.as("qualifier_spaced").then(rules["qualifier_letter"]));
|
|
57
|
-
// Print-form suffixes spliced after code, before combined_suffixes.
|
|
58
|
-
rule("code_suffixes", () => rules["series_suffix_spaced"]
|
|
59
|
-
.maybe()
|
|
60
|
-
.then(rules["qualifier_spaced"].maybe()));
|
|
61
|
-
rule("attachment", () => space.then(str("attachment").as("attachment")));
|
|
62
|
-
// "ITU-T Q.120-Q.139 (11/1988)" — one document covering a range.
|
|
63
|
-
rule("range_end", () => dash.then(letter.repeat(1, 3).then(dot, digits).as("range_end")));
|
|
64
|
-
rule("date_part", () => space.then(str("("), digits.as("month").then(str("/")).maybe(), digit.repeat(4, 4).as("year"), str(")")));
|
|
65
|
-
// A "-YYYYMM" approval date — the "200307" of "T-REC-T.4-200307-I" and
|
|
66
|
-
// "ITU-T T.4-200307". ITU's own edition suffix is short ("-5"), so six
|
|
67
|
-
// digits that read as a plausible year (19xx/20xx) and month (01-12) are
|
|
68
|
-
// the date, never a part. A six-digit run that fails either test
|
|
69
|
-
// ("-200313", "-180001") is still a part, as it was before.
|
|
70
|
-
rule("yyyymm_year", () => str("19").or(str("20")).then(digit.repeat(2, 2)));
|
|
71
|
-
rule("yyyymm_month", () => str("0").then(match("[1-9]")).or(str("1").then(match("[0-2]"))));
|
|
72
|
-
rule("yyyymm_shape", () => rules["yyyymm_year"].then(rules["yyyymm_month"], digit.absent()));
|
|
73
|
-
rule("part", () => dash.then(rules["yyyymm_shape"].absent(), digits.as("part")));
|
|
74
|
-
rule("parts", () => rules["part"].repeat(0, Infinity).as("parts"));
|
|
75
|
-
// Imp code first: the standard code needs digits, which "Imp712" lacks.
|
|
76
|
-
rule("imp_code", () => str("Imp")
|
|
77
|
-
.as("imp_marker")
|
|
78
|
-
.then(digits.or(letter.repeat(1, 3)).as("number"), rules["subseries"].maybe(), rules["parts"]));
|
|
79
|
-
rule("standard_code", () => rules["number"]
|
|
80
|
-
.then(rules["series_suffix"].maybe(), rules["subseries"].maybe(), rules["parts"], rules["qualifier_glued"].maybe()));
|
|
81
|
-
rule("code", () => rules["imp_code"].or(rules["standard_code"]));
|
|
82
|
-
// The status letter that trails the date in a publication id — "I" (in
|
|
83
|
-
// force) or "S" (superseded). It names the state of the edition, not the
|
|
84
|
-
// edition, so it is parsed and dropped. "S" is also the Spanish language
|
|
85
|
-
// suffix, so it is a status ONLY in the full "T-REC-…" id, where ITU
|
|
86
|
-
// always writes one; after an "ITU-T …-YYYYMM" print form only "I" is,
|
|
87
|
-
// and "-S" stays the language ("ITU-T Z.100-199911-S").
|
|
88
|
-
rule("id_status", () => dash.then(match("[IS]"), match("[A-Za-z0-9]").absent()));
|
|
89
|
-
rule("print_id_status", () => dash.then(str("I"), match("[A-Za-z0-9]").absent()));
|
|
90
|
-
rule("yyyymm_date", () => dash.then(rules["yyyymm_year"].as("year"), rules["yyyymm_month"].as("month"), digit.absent()));
|
|
91
|
-
rule("id_date", () => rules["yyyymm_date"].then(rules["print_id_status"].maybe()));
|
|
92
|
-
// Either date spelling of a Recommendation.
|
|
93
|
-
rule("document_date", () => rules["date_part"].or(rules["id_date"]));
|
|
94
|
-
// "ITU-T REC T.4", "ITU-T REC-T.4" — the redundant type word of ITU's
|
|
95
|
-
// own URLs. Not captured: a Recommendation is the default type.
|
|
96
|
-
rule("rec_word", () => str("REC").then(space.or(dash)));
|
|
97
|
-
// "(V14)" plus the bare spellings "V2", "v10", "v.1" — all
|
|
98
|
-
// normalise to the parenthesised form on render.
|
|
99
|
-
rule("version_part", () => space.then(str("(V")
|
|
100
|
-
.then(digits.as("version"), str(")"))
|
|
101
|
-
.or(str("V")
|
|
102
|
-
.or(str("v"))
|
|
103
|
-
.then(dot.maybe(), digits.as("version")))));
|
|
104
|
-
rule("language", () => dash.then(match("[EFASCR]").as("language")));
|
|
105
|
-
// "/Y.1351" joint designations, repeatable for triples. Each
|
|
106
|
-
// designation carries its own print-form suffixes ("D.81/F.80 bis").
|
|
107
|
-
rule("combined_designation", () => str("/").then(rules["series"]
|
|
108
|
-
.then(dot, digits.as("number"), rules["subseries"].maybe(), rules["parts"], rules["qualifier_glued"].maybe(), rules["series_suffix_spaced"].maybe(), rules["qualifier_spaced"].maybe())
|
|
109
|
-
.as("designation")));
|
|
110
|
-
rule("combined_suffixes", () => rules["combined_designation"].repeat(1, Infinity).as("combined"));
|
|
111
|
-
// "Technical" is bound to the Cor. branch alone — offered at the
|
|
112
|
-
// head it would be silently dropped on "Technical Err. 1" and
|
|
113
|
-
// collapse that onto another document.
|
|
114
|
-
rule("technical_marker", () => str("Technical").as("technical").then(space));
|
|
115
|
-
rule("supplement_type", () => str("Suppl.")
|
|
116
|
-
.or(str("Suppl"), str("Amd."), str("Amd"), str("Add."), str("Add"), str("Err."), str("Err"))
|
|
117
|
-
.as("supplement_type")
|
|
118
|
-
.or(rules["technical_marker"]
|
|
119
|
-
.maybe()
|
|
120
|
-
.then(str("Cor.").or(str("Cor")).as("supplement_type"))));
|
|
121
|
-
// The captured space marks the SPACED ordinal; its absence is the
|
|
122
|
-
// glued flag. The ordinal itself may be dotted ("M Suppl. 1.1").
|
|
123
|
-
rule("supplement_number", () => space
|
|
124
|
-
.as("supplement_space")
|
|
125
|
-
.maybe()
|
|
126
|
-
.then(digits.then(dot.then(digits).repeat(0, Infinity)).as("supplement_number")));
|
|
127
|
-
rule("supplement_date", () => space.then(str("("), digits.as("supplement_month").then(str("/")).maybe(), digit.repeat(4, 4).as("supplement_year"), str(")")));
|
|
128
|
-
rule("base_with_series", () => rules["itu_prefix"]
|
|
129
|
-
.then(rules["sector"], space, rules["rec_word"].maybe(), rules["series"], dot, rules["code"], rules["range_end"].maybe(), rules["code_suffixes"], rules["combined_suffixes"].maybe(), rules["series_word"].maybe(), rules["attachment"].maybe(), rules["version_part"].maybe(), rules["document_date"].maybe()));
|
|
130
|
-
rule("base_without_series", () => rules["itu_prefix"]
|
|
131
|
-
.then(rules["sector"], space, rules["code"], rules["code_suffixes"], rules["attachment"].maybe(), rules["version_part"].maybe(), rules["document_date"].maybe()));
|
|
132
|
-
// Series-code documents ("EMC-5", "SEC-QKD"): 2+ letter mnemonic,
|
|
133
|
-
// dash-joined number. The OB guard keeps "ITU-T OB-1" a clean parse
|
|
134
|
-
// failure rather than an escaped ArgumentError.
|
|
135
|
-
rule("series_code_body", () => str("OB")
|
|
136
|
-
.then(dash)
|
|
137
|
-
.absent()
|
|
138
|
-
.then(letter.repeat(2, Infinity).as("series"), dash.as("series_dash"), digits.or(letter.repeat(1, Infinity)).as("number"), rules["parts"]));
|
|
139
|
-
// "ITU-R SG17-C1000" (pubid#340) — the "-C" marker distinguishes it.
|
|
140
|
-
rule("contribution", () => rules["itu_prefix"]
|
|
141
|
-
.then(rules["sector"], space, rules["series"], str("-C").as("contribution_marker"), rules["number"], rules["parts"], rules["language"].maybe()));
|
|
142
|
-
rule("base_series_code", () => rules["itu_prefix"]
|
|
143
|
-
.then(rules["sector"], space, rules["series_code_body"], rules["version_part"].maybe(), rules["date_part"].maybe()));
|
|
144
|
-
rule("series_code_identifier", () => rules["base_series_code"].then(rules["language"].maybe()));
|
|
145
|
-
rule("report_word", () => str("Report").as("report_marker"));
|
|
146
|
-
// No combined_suffixes: a joint Report would silently drop the
|
|
147
|
-
// marker in the combined branch; a clean failure is better. The OB
|
|
148
|
-
// guard mirrors series_code_body's.
|
|
149
|
-
rule("report_body", () => str("OB")
|
|
150
|
-
.then(dot)
|
|
151
|
-
.absent()
|
|
152
|
-
.then(rules["series"].then(dot).maybe(), rules["code"], rules["range_end"].maybe(), rules["code_suffixes"], rules["series_word"].maybe(), rules["attachment"].maybe(), rules["version_part"].maybe(), rules["date_part"].maybe()));
|
|
153
|
-
rule("base_report", () => rules["report_word"]
|
|
154
|
-
.then(space, rules["itu_prefix"], rules["sector"], space, rules["report_body"])
|
|
155
|
-
.or(rules["itu_prefix"].then(rules["sector"], space, rules["report_word"], space, rules["report_body"])));
|
|
156
|
-
rule("report_identifier", () => rules["base_report"].then(rules["language"].maybe()));
|
|
157
|
-
// ITU-R Resolution ("Resolution ITU-R 1-9 (2023)"): a number and its
|
|
158
|
-
// revision, never a series. Like the Report marker, the word is
|
|
159
|
-
// captured, and both the leading and the infix spelling are accepted.
|
|
160
|
-
rule("resolution_word", () => str("Resolution").or(str("Res.")).as("resolution_marker"));
|
|
161
|
-
rule("resolution_body", () => rules["code"].then(rules["document_date"].maybe()));
|
|
162
|
-
rule("base_resolution", () => rules["resolution_word"]
|
|
163
|
-
.then(space, rules["itu_prefix"], rules["sector"], space, rules["resolution_body"])
|
|
164
|
-
.or(rules["itu_prefix"].then(rules["sector"], space, rules["resolution_word"], space, rules["resolution_body"])));
|
|
165
|
-
rule("resolution_identifier", () => rules["base_resolution"].then(rules["language"].maybe()));
|
|
166
|
-
rule("base", () => rules["base_report"].or(rules["base_with_series"], rules["base_without_series"], rules["base_series_code"]));
|
|
167
|
-
// Annex label: one letter, optional number and/or "+" ("F3", "C+").
|
|
168
|
-
rule("annex_label", () => letter.then(digits.maybe(), str("+").maybe()));
|
|
169
|
-
rule("annex_body", () => rules["base"]
|
|
170
|
-
.as("base")
|
|
171
|
-
.then(space, str("Annex"), space, rules["annex_label"].as("annex_number"), rules["date_part"].maybe()));
|
|
172
|
-
rule("annex_identifier", () => rules["annex_body"].then(rules["language"].maybe()));
|
|
173
|
-
rule("roman", () => match("[IVX]").repeat(1, Infinity));
|
|
174
|
-
rule("appendix_material", () => space.then(str("test vectors").or(str("Software")).as("appendix_material")));
|
|
175
|
-
rule("appendix_body", () => rules["base"]
|
|
176
|
-
.as("base")
|
|
177
|
-
.then(space, str("App."), space.maybe(), rules["roman"].as("appendix_number"), rules["appendix_material"].maybe(), rules["date_part"].maybe()));
|
|
178
|
-
rule("appendix_identifier", () => rules["appendix_body"].then(rules["language"].maybe()));
|
|
179
|
-
rule("supplement_with_base", () => rules["annex_body"]
|
|
180
|
-
.as("base")
|
|
181
|
-
.or(rules["appendix_body"].as("base"), rules["base"].as("base"))
|
|
182
|
-
.then(space, rules["supplement_type"], rules["supplement_number"], rules["supplement_date"].maybe(), rules["language"].maybe()));
|
|
183
|
-
// series_group FIRST: the greedy 1-3 letter series would take the
|
|
184
|
-
// "E" of "E-100" and strand the required space.
|
|
185
|
-
rule("supplement_series_only", () => rules["itu_prefix"]
|
|
186
|
-
.then(rules["sector"], space, rules["series_group"].or(rules["series"]), rules["series_word"].maybe(), space, rules["supplement_type"], rules["supplement_number"], rules["supplement_date"].maybe(), rules["language"].maybe()));
|
|
187
|
-
// A supplement whose base is itself a supplement (Err. on Amd.).
|
|
188
|
-
rule("chained_supplement", () => rules["supplement_with_base"]
|
|
189
|
-
.or(rules["supplement_series_only"])
|
|
190
|
-
.as("base")
|
|
191
|
-
.then(space, rules["supplement_type"], rules["supplement_number"], rules["supplement_date"].maybe(), rules["language"].maybe()));
|
|
192
|
-
// "Amd. 1/Technical Cor. 1" — one Technical Corrigendum against an
|
|
193
|
-
// Amendment, sharing the trailing date. The "/" marker round-trips.
|
|
194
|
-
rule("slash_chained_supplement", () => rules["supplement_with_base"]
|
|
195
|
-
.as("base")
|
|
196
|
-
.then(str("/").as("supplement_slash"), rules["supplement_type"], rules["supplement_number"], rules["supplement_date"].maybe(), rules["language"].maybe()));
|
|
197
|
-
rule("supplement_identifier", () => rules["chained_supplement"]
|
|
198
|
-
.or(rules["slash_chained_supplement"], rules["supplement_with_base"], rules["supplement_series_only"]));
|
|
199
|
-
rule("with_series", () => rules["itu_prefix"]
|
|
200
|
-
.then(rules["sector"], space, rules["rec_word"].maybe(), rules["series"], dot, rules["code"], rules["range_end"].maybe(), rules["code_suffixes"], rules["combined_suffixes"].maybe(), rules["series_word"].maybe(), rules["attachment"].maybe(), rules["version_part"].maybe(), rules["document_date"].maybe(), rules["language"].maybe()));
|
|
201
|
-
rule("without_series", () => rules["itu_prefix"]
|
|
202
|
-
.then(rules["sector"], space, rules["code"], rules["code_suffixes"], rules["attachment"].maybe(), rules["version_part"].maybe(), rules["document_date"].maybe(), rules["language"].maybe()));
|
|
203
|
-
rule("ob_series", () => str("OB").as("series"));
|
|
204
|
-
rule("ob_dot_body", () => dot.then(rules["number"]));
|
|
205
|
-
rule("ob_no_body", () => space.then(str("No."), space, rules["number"]));
|
|
206
|
-
// "ITU OB 1000" — metanorma-itu's docidentifier ("Annex to ITU OB %").
|
|
207
|
-
// Accepted as an input spelling only; it renders "ITU OB No. 1000", the
|
|
208
|
-
// form ITU's own bulletin site uses.
|
|
209
|
-
rule("ob_bare_body", () => space.then(rules["number"]));
|
|
210
|
-
// The date as a bulletin prints it — "ITU-T OB.1096 - 15.III.2016": day,
|
|
211
|
-
// Roman month, year. The months are tried longest first, because PEG
|
|
212
|
-
// takes the first alternative that matches and "I" would otherwise win
|
|
213
|
-
// on "III"; "XIII" matches "XII", then fails on the required dot.
|
|
214
|
-
rule("roman_month", () => str("XII")
|
|
215
|
-
.or(str("XI"))
|
|
216
|
-
.or(str("X"))
|
|
217
|
-
.or(str("IX"))
|
|
218
|
-
.or(str("VIII"))
|
|
219
|
-
.or(str("VII"))
|
|
220
|
-
.or(str("VI"))
|
|
221
|
-
.or(str("V"))
|
|
222
|
-
.or(str("IV"))
|
|
223
|
-
.or(str("III"))
|
|
224
|
-
.or(str("II"))
|
|
225
|
-
.or(str("I")));
|
|
226
|
-
rule("ob_roman_date", () => str(" - ")
|
|
227
|
-
.then(digit.repeat(2, 2).as("day"), dot, rules["roman_month"].as("roman_month"), dot, digit.repeat(4, 4).as("year")));
|
|
228
|
-
rule("ob_date", () => rules["date_part"].or(rules["ob_roman_date"]));
|
|
229
|
-
rule("ob_with_sector", () => rules["itu_prefix"]
|
|
230
|
-
.then(rules["sector"].then(space).maybe(), rules["ob_series"], rules["ob_dot_body"].or(rules["ob_no_body"]).or(rules["ob_bare_body"]), rules["ob_date"].maybe(), rules["language"].maybe()));
|
|
231
|
-
rule("ob_long_form", () => rules["itu_prefix"]
|
|
232
|
-
.then(rules["sector"].then(space).maybe(), str("Operational Bulletin").as("_op_bull"), space, str("No."), space, rules["number"], rules["ob_date"].maybe(), rules["language"].maybe()));
|
|
233
|
-
rule("special_publication", () => rules["ob_with_sector"].or(rules["ob_long_form"]));
|
|
234
|
-
rule("annex_to_identifier", () => str("Annex to").then(space, rules["special_publication"].as("annex_to")));
|
|
235
|
-
rule("handbook", () => rules["itu_prefix"]
|
|
236
|
-
.then(rules["sector"], space, rules["number"], dot, str("HDB").as("handbook_marker"), rules["date_part"].maybe()));
|
|
237
|
-
rule("numeric_question", () => rules["itu_prefix"]
|
|
238
|
-
.then(rules["sector"], space, rules["number"], rules["parts"], str("/"), digits.as("study_group"), str(":").as("question_colon").maybe()));
|
|
239
|
-
rule("question_tail", () => rules["number"]
|
|
240
|
-
.then(str("/BL").as("has_bl").maybe(), str("/"), digits.as("study_group")));
|
|
241
|
-
rule("letter_question", () => rules["itu_prefix"]
|
|
242
|
-
.then(rules["sector"], space, rules["series"], dot, str("[")
|
|
243
|
-
.as("bracketed")
|
|
244
|
-
.then(rules["question_tail"], str("]"))
|
|
245
|
-
.or(rules["question_tail"]), str(":").as("question_colon").maybe()));
|
|
246
|
-
rule("common_text_twin", () => space
|
|
247
|
-
.then(str("|"), space, match("[^|]").repeat(1, Infinity))
|
|
248
|
-
.as("common_text_twin"));
|
|
249
|
-
// ITU's publication id — "T-REC-T.4-200307-I",
|
|
250
|
-
// "R-REC-BO.1130-5-202602-I": <sector>-REC-<number>[-<edition>]-<YYYYMM>
|
|
251
|
-
// [-<status>], the name ITU gives each edition in its URLs and PDF
|
|
252
|
-
// files. It builds the plain Recommendation it names and renders in the
|
|
253
|
-
// print form ("ITU-T T.4 (07/2003)"). The date is required: without it
|
|
254
|
-
// the string names no edition. No other rule starts with a bare sector
|
|
255
|
-
// letter, so the slot is free.
|
|
256
|
-
rule("publication_id", () => rules["sector"]
|
|
257
|
-
.then(dash, str("REC"), dash, rules["series"], dot, rules["code"], rules["yyyymm_date"], rules["id_status"].maybe(), rules["language"].maybe()));
|
|
258
|
-
// The Radio Regulations — "ITU-R RR", "ITU-R RR (2020)", and the URL
|
|
259
|
-
// spelling "ITU-R RR-2020". Always ITU-R. The trailing any.absent? is
|
|
260
|
-
// load-bearing: PEG ordered choice never re-enters the alternation once
|
|
261
|
-
// an alternative succeeds, so a partial match on "ITU-R RR.1" must fail
|
|
262
|
-
// here and fall through to with_series.
|
|
263
|
-
rule("radio_regulations", () => rules["itu_prefix"]
|
|
264
|
-
.then(str("R").as("sector"), space, str("RR").as("radio_regulations"), rules["date_part"].or(dash.then(digit.repeat(4, 4).as("year"))).maybe(), rules["language"].maybe(), match(".").absent()));
|
|
265
|
-
rule("identifier", () => rules["annex_to_identifier"]
|
|
266
|
-
.or(rules["special_publication"], rules["supplement_identifier"], rules["annex_identifier"], rules["appendix_identifier"], rules["report_identifier"], rules["resolution_identifier"], rules["handbook"], rules["numeric_question"], rules["letter_question"], rules["radio_regulations"], rules["with_series"], rules["contribution"], rules["series_code_identifier"], rules["without_series"], rules["publication_id"]));
|
|
267
|
-
rule("root", () => rules["identifier"]
|
|
268
|
-
.then(rules["common_text_twin"])
|
|
269
|
-
.or(rules["identifier"]));
|
|
270
|
-
return rules;
|
|
271
|
-
}
|
|
272
|
-
/** ITU's listings carry doubled spaces; whitespace is never significant. */
|
|
273
|
-
export function normalizeWhitespaceItu(input) {
|
|
274
|
-
return input.replace(/\s+/g, " ").trim();
|
|
275
|
-
}
|
|
276
|
-
export const ituGrammar = { rules: buildRules(), root: "root" };
|