@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,342 +0,0 @@
|
|
|
1
|
-
import { match, ref, str } from "../../grammar/engine.js";
|
|
2
|
-
/**
|
|
3
|
-
* Port of lib/pubid/nist/parser.rb — 1:1 translation. The identifier
|
|
4
|
-
* alternation order is load-bearing: circ_supplement | dated | mr |
|
|
5
|
-
* research_library | compound_series | publisher+series | bare series.
|
|
6
|
-
*/
|
|
7
|
-
const COMPOUND_SERIES = [
|
|
8
|
-
"NBS BRPD-CRPL-D", "NBS CRPL-F-A", "NBS CRPL-F-B",
|
|
9
|
-
"NBS CS-E", "CSRC Building Block", "CSRC Use Case", "CSRC Book",
|
|
10
|
-
"ITL Bulletin", "NSRDS-NBS",
|
|
11
|
-
"NIST LCIRC", "NBS LCIRC", "NIST.LCIRC", "NBS.LCIRC", "NBS RPT",
|
|
12
|
-
"NIST PS", "NIST DCI", "NIST Other",
|
|
13
|
-
"NISTPUB",
|
|
14
|
-
"NBS CSM", "NBS CIRC", "NBS.CRPL", "NBS CRPL", "NBS CS",
|
|
15
|
-
"NBS CIS", "NBS HR", "NBS IRPL", "NBS IP", "NBS PS",
|
|
16
|
-
"NBS BH",
|
|
17
|
-
];
|
|
18
|
-
const SIMPLE_SERIES = [
|
|
19
|
-
"AMS", "VTS", "BSS", "BMS", "BH",
|
|
20
|
-
"FIPS", "GCR", "HB", "MONO", "MP", "NCSTAR", "NSRDS", "IR",
|
|
21
|
-
"SP", "TN", "CSWP",
|
|
22
|
-
"AI", "CIRC", "CS", "CSM",
|
|
23
|
-
"CRPL", "LCIRC", "OWMWP", "PC", "RPT",
|
|
24
|
-
"SIBS", "TIBM", "TTB", "EAB",
|
|
25
|
-
"JPCRD", "JRES",
|
|
26
|
-
"CHIPS", "NWIRP", "RB",
|
|
27
|
-
];
|
|
28
|
-
const MONTHS = [
|
|
29
|
-
"January", "February", "March", "April", "May", "June", "July",
|
|
30
|
-
"August", "September", "October", "November", "December",
|
|
31
|
-
"Jan", "Feb", "Mar", "Apr", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
32
|
-
];
|
|
33
|
-
function literalAlternation(tokens) {
|
|
34
|
-
const sorted = [...new Set(tokens)].sort((a, b) => b.length - a.length);
|
|
35
|
-
return sorted.map((t) => str(t)).reduce((a, b) => a.or(b));
|
|
36
|
-
}
|
|
37
|
-
function buildRules() {
|
|
38
|
-
const rules = {};
|
|
39
|
-
const rule = (name, build) => {
|
|
40
|
-
rules[name] = build();
|
|
41
|
-
};
|
|
42
|
-
const space = str(" ");
|
|
43
|
-
const dot = str(".");
|
|
44
|
-
const dash = str("-");
|
|
45
|
-
const slash = str("/");
|
|
46
|
-
const digit = match("[0-9]");
|
|
47
|
-
const digits = digit.repeat(1, Infinity);
|
|
48
|
-
const upperLetter = match("[A-Z]");
|
|
49
|
-
const lowerLetter = match("[a-z]");
|
|
50
|
-
const letter = match("[A-Za-z]");
|
|
51
|
-
const monthAbbrev = () => literalAlternation(MONTHS);
|
|
52
|
-
const anyChar = match("[\\s\\S]");
|
|
53
|
-
rule("hash_prefix", () => str("#"));
|
|
54
|
-
rule("month_abbrev", () => monthAbbrev());
|
|
55
|
-
rule("language_code", () => (space.or(dot))
|
|
56
|
-
.maybe()
|
|
57
|
-
.then(literalAlternation(["es", "pt", "chi", "viet", "port", "esp"]).or(match("[a-z]").repeat(2, 4)))
|
|
58
|
-
.as("translation"));
|
|
59
|
-
const stageId = () => str("i").or(str("I"), str("f"), str("F"), str("1"), str("2"), str("3"), str("4"), str("5"), str("6"), str("7"), str("8"), str("9"));
|
|
60
|
-
const stageType = () => str("pd").or(str("PD"), str("wd"), str("WD"), str("prd"), str("PRD"));
|
|
61
|
-
rule("old_stage", () => str("(")
|
|
62
|
-
.then(stageId().as("stage_id"), stageType().as("stage_type"))
|
|
63
|
-
.as("stage")
|
|
64
|
-
.then(str(")")));
|
|
65
|
-
rule("new_stage", () => (space.or(dot))
|
|
66
|
-
.then(stageId().as("stage_id"), stageType().as("stage_type"))
|
|
67
|
-
.as("stage"));
|
|
68
|
-
rule("publisher", () => str("NBS").or(str("NIST")).as("publisher"));
|
|
69
|
-
rule("compound_series", () => literalAlternation(COMPOUND_SERIES).as("series"));
|
|
70
|
-
rule("simple_series", () => literalAlternation(SIMPLE_SERIES).as("series"));
|
|
71
|
-
rule("number_suffix", () => str("U")
|
|
72
|
-
.then(lowerLetter)
|
|
73
|
-
.or(
|
|
74
|
-
// An "r" directly followed by a digit is the revision marker
|
|
75
|
-
// (pubid#170), not a suffix — leave it for the edition rules.
|
|
76
|
-
str("r")
|
|
77
|
-
.then(digit)
|
|
78
|
-
.absent()
|
|
79
|
-
.then(letter, literalAlternation([
|
|
80
|
-
"ec", "ndex", "ndx", "nsert", "rrata", "raft", "pp", "s", "t",
|
|
81
|
-
"hi", "iet", "ort", "r", "p",
|
|
82
|
-
]).absent(), digits.maybe())));
|
|
83
|
-
rule("digits_with_suffix", () => digits.then(ref(rules, "number_suffix").then(digit.absent()).maybe()));
|
|
84
|
-
// The polymorphic number wrapper is split per branch (asme's
|
|
85
|
-
// designator/designator_code pattern): first_number over the bare
|
|
86
|
-
// branches, first_number_composite over the branches carrying inner
|
|
87
|
-
// captures — with the alternation order untouched.
|
|
88
|
-
rule("first_number", () => ref(rules, "owmwp_date_number")
|
|
89
|
-
.as("first_number_composite")
|
|
90
|
-
.or(str("ADHOC").as("first_number"), str("div").then(digits).as("first_number"), monthAbbrev().then(dash, monthAbbrev(), digits).as("first_number"), digits
|
|
91
|
-
.as("number")
|
|
92
|
-
.then(str("v"), digits.as("volume_suffix"))
|
|
93
|
-
.as("number_with_volume")
|
|
94
|
-
.as("first_number_composite"), digits
|
|
95
|
-
.then(dash, literalAlternation(["III", "II", "IV", "I", "V", "VI", "VII", "VIII", "IX", "X"]), dash, digits, dot.then(digits).maybe())
|
|
96
|
-
.as("first_number"), digits.then(str("GB"), dash, digits, upperLetter.maybe()).as("first_number"), digits.then(upperLetter, dash, digits).as("first_number"), str("v")
|
|
97
|
-
.then(digits.as("volume_number"), str("n"), digits.as("issue_number"))
|
|
98
|
-
.as("first_number_composite"), digits.then(str("supprev")).as("first_number"), digits.then(str("e"), digits, str("rev"), digits).as("first_number"), digits
|
|
99
|
-
.as("number")
|
|
100
|
-
.then(str("rv"), digits.as("revision_year"))
|
|
101
|
-
.as("number_with_rev_year")
|
|
102
|
-
.as("first_number_composite"), digits.then(str("e"), digits, str("rev"), monthAbbrev(), digits).as("first_number"), digits.then(str("e"), digits, str("supp"), digits.maybe()).as("first_number"), str("e").then(digits, str("rev"), monthAbbrev(), digits).as("first_number"), str("e").then(digits, str("supp"), digits.maybe()).as("first_number"), digits.then(str("e"), digits).as("first_number"), str("e").then(digits, dash.then(digits).absent()).as("first_number"), lowerLetter.then(digits).as("first_number"), digits.then(str("supp"), monthAbbrev(), digits).as("first_number"), digits.then(str("supp"), digits.maybe()).as("first_number"), digits.then(str("sup"), monthAbbrev(), digits).as("first_number"), digits.then(str("sup")).as("first_number"), digits
|
|
103
|
-
.as("number")
|
|
104
|
-
.then(literalAlternation(["sp", "pt", "es", "SP", "PT", "ES"]).as("language_code"), upperLetter.absent(), digit.absent(), letter.absent(), dash.absent(), dot.absent())
|
|
105
|
-
.as("first_number_composite"), digits
|
|
106
|
-
.as("number")
|
|
107
|
-
.then(str("pt"), digits.as("part_number"), str("e"), digits.as("edition_year"))
|
|
108
|
-
.as("first_number_composite"), digits
|
|
109
|
-
.as("number")
|
|
110
|
-
.then(str("("), literalAlternation(["SP", "PT", "ES"]).as("language_code"), str(")"))
|
|
111
|
-
.as("first_number_composite"), digits
|
|
112
|
-
.as("number")
|
|
113
|
-
.then(upperLetter.as("letter_suffix"), str("r"), digits.as("revision_id"))
|
|
114
|
-
.as("number_with_letter_revision")
|
|
115
|
-
.as("first_number_composite"), rules["digits_with_suffix"].as("first_number")));
|
|
116
|
-
// OWMWP date number: MM-DD-YYYY — must precede the other shapes.
|
|
117
|
-
rule("owmwp_date_number", () => match("[0-9]")
|
|
118
|
-
.repeat(2, 2)
|
|
119
|
-
.as("owmwp_month")
|
|
120
|
-
.then(dash, match("[0-9]").repeat(2, 2).as("owmwp_day"), dash, match("[0-9]").repeat(4, 4).as("owmwp_year"))
|
|
121
|
-
.as("owmwp_date_number"));
|
|
122
|
-
// The polymorphic wrapper is split per branch —
|
|
123
|
-
// second_number_composite over the branches carrying inner captures
|
|
124
|
-
// (revision_letter, number_only+edition_id, revision_simple),
|
|
125
|
-
// second_number over the bare ones — with the alternation order and
|
|
126
|
-
// the first branch's month/draft guards untouched.
|
|
127
|
-
rule("second_number", () => monthAbbrev()
|
|
128
|
-
.absent()
|
|
129
|
-
.then(str("draft").absent(), digits
|
|
130
|
-
.as("number_only")
|
|
131
|
-
.then(str("r"), letter.as("letter"))
|
|
132
|
-
.as("revision_letter")
|
|
133
|
-
.as("second_number_composite"))
|
|
134
|
-
.or(digits
|
|
135
|
-
.then(literalAlternation(["supp", "sup"]), digit.absent(), letter.absent())
|
|
136
|
-
.as("second_number"), digits.then(str("r"), digits, str("U"), lowerLetter).as("second_number"), digits.then(str("r"), digits, letter).as("second_number"), digits
|
|
137
|
-
.as("number_only")
|
|
138
|
-
.then(str("r"), digits.then(dot.then(digits).maybe()).as("edition_id"))
|
|
139
|
-
.as("second_number_composite"), digits.then(str("_"), digits, dash, digits, upperLetter.maybe()).as("second_number"), lowerLetter.then(dash, digits).as("second_number"), digits.then(str("pt"), digits, dash.absent()).as("second_number"), digits.then(upperLetter).as("second_number"), digits
|
|
140
|
-
.as("number_only")
|
|
141
|
-
.then(str("r"), letter.as("letter"))
|
|
142
|
-
.as("revision_letter")
|
|
143
|
-
.as("second_number_composite"), str("r").then(letter).as("revision_letter_suffix"), str("r")
|
|
144
|
-
.then(digits.then(dot.then(digits).maybe()).as("edition_id"))
|
|
145
|
-
.as("revision_simple")
|
|
146
|
-
.as("second_number_composite"), str("NCNR").as("second_number"), str("PERMIS").as("second_number"), str("BFRL").as("second_number"),
|
|
147
|
-
// A trailing lowercase means a capitalized word ("Suppl"),
|
|
148
|
-
// not a second number.
|
|
149
|
-
upperLetter.repeat(1, 3).then(lowerLetter.absent()).as("second_number"), rules["digits_with_suffix"]
|
|
150
|
-
.then(dash.then(monthAbbrev(), digits, slash).absent())
|
|
151
|
-
.as("second_number"), lowerLetter.then(digit.absent()).as("second_number")));
|
|
152
|
-
const dottedDigits = () => digits.then(dot.then(digits).maybe());
|
|
153
|
-
const editionInner = () => space
|
|
154
|
-
.maybe()
|
|
155
|
-
.then(str("e"), dottedDigits().as("edition_id"))
|
|
156
|
-
.as("edition_e")
|
|
157
|
-
.or(space
|
|
158
|
-
.then(str("r"), dottedDigits().as("edition_id"), letter.as("edition_letter"))
|
|
159
|
-
.as("edition_r_with_space_letter"), space.then(str("r"), dottedDigits().as("edition_id")).as("edition_r_with_space"), str("r")
|
|
160
|
-
.then(dottedDigits().as("edition_id"), letter.as("edition_letter"))
|
|
161
|
-
.as("edition_r_no_space_letter"), str("r").then(dottedDigits().as("edition_id")).as("edition_r_no_space"), space
|
|
162
|
-
.maybe()
|
|
163
|
-
.then(str("rev"), space.maybe(), digits.as("edition_id"))
|
|
164
|
-
.as("edition_rev"), dash.then(match("[1-9]").as("edition_id"), digit.absent()).as("edition_historical"), dash
|
|
165
|
-
.then(match("[0-9]").repeat(4, 4).as("dash_year"))
|
|
166
|
-
.as("edition_dash_year"));
|
|
167
|
-
rule("edition", () => editionInner());
|
|
168
|
-
rule("date", () => dash
|
|
169
|
-
.then(match("[0-9]").repeat(4, 4).as("date_year"), match("[0-9]").repeat(2, 2).as("date_month"), match("[0-9]").repeat(2, 2).as("date_day"))
|
|
170
|
-
.as("date")
|
|
171
|
-
.or(dash
|
|
172
|
-
.then(match("[0-9]").repeat(4, 4).as("date_year"), match("[0-9]").repeat(2, 2).as("date_month"))
|
|
173
|
-
.as("date"), dash.then(match("[0-9]").repeat(4, 4).as("date_year")).as("date"), dash
|
|
174
|
-
.then(monthAbbrev().as("date_month"), digits.as("date_year"))
|
|
175
|
-
.as("date")));
|
|
176
|
-
rule("iso_date", () => match("[0-9]")
|
|
177
|
-
.repeat(4, 4)
|
|
178
|
-
.as("date_year")
|
|
179
|
-
.then(dash, match("[0-9]").repeat(2, 2).as("date_month"), dash, match("[0-9]").repeat(2, 2).as("date_day")));
|
|
180
|
-
rule("dated_identifier", () => rules["hash_prefix"]
|
|
181
|
-
.maybe()
|
|
182
|
-
.then(rules["publisher"], space.or(dot), rules["iso_date"].as("dated_date"), space.or(dot), digits.as("dated_seq")));
|
|
183
|
-
rule("research_library_identifier", () => rules["publisher"]
|
|
184
|
-
.then(space, str("Research Library").as("series"), space.then(str("("), match("[0-9]").repeat(4, 4).as("year"), str(")")).maybe()));
|
|
185
|
-
rule("legacy_edition", () => (str("r").or(str(" R")))
|
|
186
|
-
.then(match("[0-9]").repeat(1, 2).as("edition"), lowerLetter.as("edition_letter"))
|
|
187
|
-
.or(str("rev").then(space.maybe(), digits.as("edition_year")), (str("e").or(str(" E"))).then(match("[0-9]").repeat(1, 3).as("edition"), str("rev"), match("[A-Za-z]").repeat(3, 9).as("edition_month"), digits.as("edition_year")), str("e").then(match("[0-9]").repeat(4, 4).as("edition_year"), match("[0-9]").repeat(2, 2).as("edition_month").maybe()), str("rev").then(match("[A-Za-z]").repeat(3, 9).as("edition_month"), digits.as("edition_year"))));
|
|
188
|
-
rule("crpl_range", () => digits
|
|
189
|
-
.then(str("_"), digits, dash, digits, upperLetter.maybe())
|
|
190
|
-
.as("crpl_range"));
|
|
191
|
-
rule("report_number", () => rules["first_number"].then(str("_").then(digits.as("edition_year"))
|
|
192
|
-
.or(dash.then(monthAbbrev().as("edition_month"), digits.as("edition_year")),
|
|
193
|
-
// FIPS date: -1-Sep30/1977
|
|
194
|
-
dash.then(digits.as("fips_part"), dash, monthAbbrev().as("edition_month"), digits.as("edition_day"), slash, digits.as("edition_year")),
|
|
195
|
-
// Decimal: -2073.3
|
|
196
|
-
dash
|
|
197
|
-
.then(digits.as("decimal_base"), dot, digits.as("decimal_suffix"))
|
|
198
|
-
.as("decimal_number"),
|
|
199
|
-
// Letter: -1A / -197Ur
|
|
200
|
-
dash
|
|
201
|
-
.then(digits.as("letter_base"), (str("U").then(lowerLetter.as("letter_suffix_extra"))).or(upperLetter).as("letter_suffix"))
|
|
202
|
-
.as("letter_number"),
|
|
203
|
-
// Dash-separated letter: -4-B
|
|
204
|
-
dash
|
|
205
|
-
.then(digits.as("letter_base"), dash, monthAbbrev().absent(), upperLetter.as("letter_suffix"), letter.or(digit).absent())
|
|
206
|
-
.as("letter_number"),
|
|
207
|
-
// Edition dash-year
|
|
208
|
-
dash
|
|
209
|
-
.then(match("[0-9]").repeat(4, 4).as("dash_year"), space.or(dot).or(ref(rules, "part")).or(ref(rules, "crpl_range")).or(ref(rules, "second_number")).or(dash).absent())
|
|
210
|
-
.as("edition_dash_year"),
|
|
211
|
-
// Second number + edition dash-year
|
|
212
|
-
dash
|
|
213
|
-
.then(rules["second_number"], dash, match("[0-9]").repeat(4, 4).as("dash_year"), space.or(dot).or(ref(rules, "part")).or(ref(rules, "crpl_range")).or(ref(rules, "revision")).or(ref(rules, "draft")).absent())
|
|
214
|
-
.as("second_number_edition_year"),
|
|
215
|
-
// FIPS month+year after part
|
|
216
|
-
dash
|
|
217
|
-
.then(rules["second_number"], dash, monthAbbrev().as("edition_month"), digits.as("edition_year"), space
|
|
218
|
-
.or(dot)
|
|
219
|
-
.or(ref(rules, "part"))
|
|
220
|
-
.or(ref(rules, "crpl_range"))
|
|
221
|
-
.or(editionInner())
|
|
222
|
-
.or(ref(rules, "revision"))
|
|
223
|
-
.or(ref(rules, "draft"))
|
|
224
|
-
.absent())
|
|
225
|
-
.as("fips_month_year_after_part"),
|
|
226
|
-
// GCR multi-dash
|
|
227
|
-
dash.then(rules["second_number"], dash, digits.then(upperLetter.maybe()).as("part_number")),
|
|
228
|
-
// Dot-separated part
|
|
229
|
-
dot.then(rules["second_number"]),
|
|
230
|
-
// Dash + (crpl_range | second_number) + edition?
|
|
231
|
-
dash.then(rules["crpl_range"].or(rules["second_number"]), editionInner().maybe()), dash.then(editionInner()))
|
|
232
|
-
.maybe()));
|
|
233
|
-
rule("volume", () => space
|
|
234
|
-
.maybe()
|
|
235
|
-
.then(literalAlternation(["Vol. ", "Vol.", "v"]))
|
|
236
|
-
.then(digits
|
|
237
|
-
.then(literalAlternation(["a-l", "m-z", "A-L", "M-Z"]).maybe())
|
|
238
|
-
.then(upperLetter.repeat(0, 2))
|
|
239
|
-
.as("volume")));
|
|
240
|
-
rule("part", () => literalAlternation([" Part. ", " Part.", " Part "])
|
|
241
|
-
.or(space.maybe().then(literalAlternation(["pt", "p", "P"])))
|
|
242
|
-
.then(digits
|
|
243
|
-
.then((space.maybe().then(str("r"), digits)).maybe())
|
|
244
|
-
.then((str("add").then((str("e").then(digits)).maybe())).maybe())
|
|
245
|
-
.then((dash.then(digits)).maybe())
|
|
246
|
-
.as("part")));
|
|
247
|
-
rule("revision", () => space
|
|
248
|
-
.maybe()
|
|
249
|
-
.then(str("r").or(str("rev")), space.maybe(), monthAbbrev().as("revision_month"), digits.as("revision_year"))
|
|
250
|
-
.or(space
|
|
251
|
-
.maybe()
|
|
252
|
-
.then(str("r").or(str("rev")), digits.as("revision"), slash, digits.as("revision_year")), (str(" r").or(str("r"))).then(space.maybe(), match("[0-9]").repeat(4, 4).as("revision_year")), str("rev").then(space.maybe(), digits.as("revision_year")), literalAlternation([" rev ", "rev", " r", "r", " Rev. ", " Rev.", " Revision (r)"])
|
|
253
|
-
.as("revision_prefix")
|
|
254
|
-
.then(space.maybe(), (digits.then(letter.maybe())).or(letter.repeat(1, Infinity)).as("revision_id"))
|
|
255
|
-
.as("revision"), str(" r").then(anyChar.absent()).as("revision_standalone")));
|
|
256
|
-
rule("version", () => (space.or(dot))
|
|
257
|
-
.maybe()
|
|
258
|
-
.then(str("ver"), space.maybe(), digits.then(dot.then(digits).repeat(0, Infinity)).as("version"))
|
|
259
|
-
.or((str(" Ver. ").or(str(" Version "))).then(digits, dot, digits, (dot.then(digits)).maybe()).as("version"), (dash.or(space))
|
|
260
|
-
.maybe()
|
|
261
|
-
.then(str("v"), digits.then(dot, digits, (dot.then(digits)).maybe()).as("version"))));
|
|
262
|
-
rule("update", () => str("/Upd")
|
|
263
|
-
.as("update_prefix")
|
|
264
|
-
.or(space.maybe().then(str("/upd").or(str("-upd"))).as("update_prefix"))
|
|
265
|
-
.then(digits
|
|
266
|
-
.as("update_number")
|
|
267
|
-
.maybe()
|
|
268
|
-
.then(dash
|
|
269
|
-
.then(match("[0-9]").repeat(4, 4).as("update_year").then(match("[0-9]").repeat(2, 2).as("update_month")).or(match("[0-9]").repeat(4, Infinity).as("update_year")))
|
|
270
|
-
.maybe())
|
|
271
|
-
.as("update")));
|
|
272
|
-
rule("addendum", () => (str("-add").or(str(".add")).or(str(" Add.")))
|
|
273
|
-
.then((space.or(dash)).maybe(), digits.or(str("")).as("addendum_number"))
|
|
274
|
-
.as("addendum"));
|
|
275
|
-
// The capitalized supplement words a letter slot must yield to.
|
|
276
|
-
rule("supplement_word", () => str("Suppl").or(str("Supp")).or(str("Sup")));
|
|
277
|
-
rule("supplement", () => space
|
|
278
|
-
.maybe()
|
|
279
|
-
.then(dot.maybe())
|
|
280
|
-
.then(
|
|
281
|
-
// The capitalized catalogue spellings ("NIST.SP.955.Suppl") ride
|
|
282
|
-
// the same slot; longest-first so "Suppl" is not "Sup"+"p".
|
|
283
|
-
str("Suppl").or(str("Supp")).or(str("Sup")).or(str("supp")).or(str("sup")))
|
|
284
|
-
.then(str("rev")
|
|
285
|
-
.as("supplement_with_rev")
|
|
286
|
-
.or(monthAbbrev()
|
|
287
|
-
.as("supp_month_start")
|
|
288
|
-
.then(digits.as("supp_year_start"), dash, monthAbbrev().as("supp_month_end"), digits.as("supp_year_end"))
|
|
289
|
-
.as("supplement_date_range"), monthAbbrev().as("supp_month").then(digits.as("supp_year")).as("supplement_date"), digits.as("supp_number").then(slash, digits.as("supp_year")).as("supplement_slash_year"), digits.as("supp_year"), match("[A-Za-z0-9]").repeat(1, Infinity).as("supplement_suffix"))
|
|
290
|
-
.maybe()));
|
|
291
|
-
rule("errata", () => dash.maybe().then(str("errata").or(str("err"))).as("errata"));
|
|
292
|
-
rule("index", () => str("index").or(str("indx")).as("index"));
|
|
293
|
-
rule("insert", () => str("insert").or(str("ins")).as("insert"));
|
|
294
|
-
rule("appendix", () => str("app").as("appendix"));
|
|
295
|
-
rule("section", () => str("sec").then(digits.as("section").maybe()));
|
|
296
|
-
rule("translation", () => str("(")
|
|
297
|
-
.then(match("\\w").repeat(3, 3).as("translation"), str(")"))
|
|
298
|
-
.or(space.then(match("\\w").repeat(3, 3).as("translation")), space.maybe().then(dot, match("\\w").repeat(3, 3).as("translation"))));
|
|
299
|
-
rule("pd_suffix", () => space.then(digits, str("pd")).as("public_draft"));
|
|
300
|
-
rule("draft", () => space
|
|
301
|
-
.then(str("(Draft)"))
|
|
302
|
-
.or(space.maybe().then(dash, str("draft"), (space.then(digits)).or(digits).maybe()), rules["pd_suffix"])
|
|
303
|
-
.as("draft"));
|
|
304
|
-
rule("fips_date", () => dash.then(digits.as("fips_part"), dash, monthAbbrev().as("fips_month"), digits.as("fips_day"), slash, digits.as("fips_year")));
|
|
305
|
-
rule("parts", () => rules["new_stage"].or(rules["section"], rules["index"], rules["insert"], rules["appendix"], rules["pd_suffix"], rules["edition"], rules["date"], rules["legacy_edition"], rules["revision"], rules["version"], rules["volume"], rules["part"], rules["update"], rules["addendum"], rules["supplement"], rules["errata"], rules["language_code"]));
|
|
306
|
-
rule("mr_identifier", () => rules["hash_prefix"]
|
|
307
|
-
.maybe()
|
|
308
|
-
.then(rules["publisher"], dot, rules["simple_series"],
|
|
309
|
-
// The catalogue also lists bare series identities with no
|
|
310
|
-
// report number ("NBS.CIRC").
|
|
311
|
-
dot.maybe(), rules["report_number"].maybe(), str("_").then(digits.as("edition_year")).maybe(), rules["supplement_word"].absent().then(upperLetter.maybe()), rules["edition"].maybe(), rules["update"].maybe(), dot
|
|
312
|
-
.then(digits.or(rules["supplement_word"].absent().then(upperLetter)))
|
|
313
|
-
.repeat(0, 3), rules["parts"].repeat(0, Infinity), rules["draft"].maybe()));
|
|
314
|
-
rule("identifier", () => ref(rules, "circ_supplement_identifier").or(rules["dated_identifier"], rules["mr_identifier"], rules["research_library_identifier"], rules["compound_series"]
|
|
315
|
-
.then(space.or(dot), rules["old_stage"].maybe(), rules["report_number"].maybe(), rules["fips_date"].maybe(), rules["parts"].repeat(0, Infinity), rules["draft"].maybe(), rules["translation"].maybe(), rules["new_stage"].maybe()), rules["publisher"]
|
|
316
|
-
.then(space.or(dot), rules["simple_series"], rules["old_stage"].maybe(), space.or(dot), rules["report_number"].maybe(), rules["fips_date"].maybe(), rules["parts"].repeat(0, Infinity), rules["draft"].maybe(), rules["translation"].maybe(), rules["new_stage"].maybe()), rules["simple_series"]
|
|
317
|
-
.then(rules["old_stage"].maybe(), space.or(dot), rules["report_number"].maybe(), rules["fips_date"].maybe(), rules["parts"].repeat(0, Infinity), rules["draft"].maybe(), rules["translation"].maybe(), rules["new_stage"].maybe())));
|
|
318
|
-
rule("circ_supplement_identifier", () => literalAlternation(["NBS CIRC", "NBS LCIRC", "NBS.CIRC", "NBS.LCIRC"])
|
|
319
|
-
.as("series")
|
|
320
|
-
.then(space.or(dot))
|
|
321
|
-
.as("circ_series")
|
|
322
|
-
.then(
|
|
323
|
-
// Bare supplement marker to the whole series, no base number
|
|
324
|
-
// ("NBS.CIRC.sup" — testsuite#5 C4).
|
|
325
|
-
((str("supp").or(str("sup"))).then(monthAbbrev().then(digits).as("supplement_month_year").or(digits.as("supp_number").then(slash, digits.as("supp_year")).as("supplement_slash_year"), str("").as("supplement_empty")).maybe())).or(
|
|
326
|
-
// Date-range supplement (no base document).
|
|
327
|
-
str("supp")
|
|
328
|
-
.then(monthAbbrev().as("supp_month_start"), digits.as("supp_year_start"), dash, monthAbbrev().as("supp_month_end"), digits.as("supp_year_end"))
|
|
329
|
-
.as("supplement_date_range")
|
|
330
|
-
.or((str("supp").or(str("sup")))
|
|
331
|
-
.then(match("[0-9]").repeat(4, 4).as("supp_year_start"), dash, match("[0-9]").repeat(4, 4).as("supp_year_end"))
|
|
332
|
-
.as("supplement_date_range"))).or(
|
|
333
|
-
// Base identifier + supplement.
|
|
334
|
-
(digits.as("base_number").then(str("e"), digits.as("edition_number")).or(digits
|
|
335
|
-
.as("base_number")
|
|
336
|
-
.then(lowerLetter.as("revision_letter"), digits.as("revision_number")), digits.as("base_number").then(upperLetter.as("letter_suffix")), digits.as("simple_number")))
|
|
337
|
-
.as("base_portion")
|
|
338
|
-
.then(((str("supp").or(str("sup"))).then((monthAbbrev().then(digits).as("supplement_month_year").or(dash.then(digits.as("supp_number"), slash, digits.as("supp_year")).as("supplement_dash_slash_year"), dash.then(digits.as("supplement_year")), digits.as("supp_number").then(slash, digits.as("supp_year")).as("supplement_slash_year"), str("").as("supplement_empty"))).maybe())).or(slash.then(digits.as("implicit_supplement_year")).as("implicit_supplement"))))));
|
|
339
|
-
rule("root", () => rules["identifier"]);
|
|
340
|
-
return rules;
|
|
341
|
-
}
|
|
342
|
-
export const nistGrammar = { rules: buildRules(), root: "root" };
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { match, ref, str, } from "../../grammar/engine.js";
|
|
2
|
-
/**
|
|
3
|
-
* 1:1 port of lib/pubid/oiml/parser.rb (including CommonParseRules).
|
|
4
|
-
* Rule names match the Ruby rule names so the two files can be diffed
|
|
5
|
-
* side by side while porting.
|
|
6
|
-
*/
|
|
7
|
-
function buildRules() {
|
|
8
|
-
const rules = {};
|
|
9
|
-
const rule = (name, build) => {
|
|
10
|
-
rules[name] = build();
|
|
11
|
-
};
|
|
12
|
-
// --- CommonParseRules ---
|
|
13
|
-
rule("space", () => str(" "));
|
|
14
|
-
rule("space?", () => ref(rules, "space").maybe());
|
|
15
|
-
rule("digits", () => match("\\d").repeat(1));
|
|
16
|
-
rule("year", () => match("\\d").repeat(4, 4).as("year"));
|
|
17
|
-
rule("comma", () => str(", "));
|
|
18
|
-
rule("comma?", () => ref(rules, "comma").maybe());
|
|
19
|
-
rule("comma_space", () => ref(rules, "comma").or(ref(rules, "space")));
|
|
20
|
-
rule("dash", () => str("-"));
|
|
21
|
-
rule("dot", () => str("."));
|
|
22
|
-
rule("words_digits", () => match("[\\dA-Za-z]").repeat(1));
|
|
23
|
-
rule("words", () => match("[A-Za-z]").repeat(1));
|
|
24
|
-
rule("words?", () => ref(rules, "words").maybe());
|
|
25
|
-
rule("year_digits", () => str("19").or(str("20")).then(match("\\d").repeat(2, 2), ref(rules, "digits").absent()));
|
|
26
|
-
rule("month_digits", () => match("\\d").repeat(2, 2));
|
|
27
|
-
rule("day_digits", () => match("\\d").repeat(2, 2));
|
|
28
|
-
rule("originator", () => ref(rules, "organization")
|
|
29
|
-
.as("publisher")
|
|
30
|
-
.then(ref(rules, "space?")
|
|
31
|
-
.then(str("/"), ref(rules, "organization").as("copublisher"))
|
|
32
|
-
.repeat(0)));
|
|
33
|
-
rule("comma_month_year", () => ref(rules, "comma").then(ref(rules, "words").as("month"), str(" "), ref(rules, "year_digits").as("year")));
|
|
34
|
-
rule("year_month", () => ref(rules, "year_digits").then(ref(rules, "dash"), ref(rules, "month_digits")));
|
|
35
|
-
// organization: OIML's parser never uses it (publisher is the literal
|
|
36
|
-
// "OIML"); provide a minimal definition so refs resolve.
|
|
37
|
-
rule("organization", () => str("OIML"));
|
|
38
|
-
// --- Additional basic rules not in CommonParseRules ---
|
|
39
|
-
rule("colon", () => str(":"));
|
|
40
|
-
rule("lparen", () => str("("));
|
|
41
|
-
rule("rparen", () => str(")"));
|
|
42
|
-
rule("slash", () => str("/"));
|
|
43
|
-
// Main identifier pattern - check supplements first
|
|
44
|
-
rule("identifier", () => ref(rules, "amendment_identifier")
|
|
45
|
-
.or(ref(rules, "amendment_short"))
|
|
46
|
-
.or(ref(rules, "annex_letter_identifier"))
|
|
47
|
-
.or(ref(rules, "annex_identifier"))
|
|
48
|
-
.or(ref(rules, "plus_supplement_identifier"))
|
|
49
|
-
.or(ref(rules, "trailing_supplement_identifier"))
|
|
50
|
-
.or(ref(rules, "cs_identifier"))
|
|
51
|
-
.or(ref(rules, "bulletin_identifier"))
|
|
52
|
-
.or(ref(rules, "base")));
|
|
53
|
-
// Publisher - always "OIML"
|
|
54
|
-
rule("publisher", () => str("OIML").as("publisher").then(ref(rules, "space")));
|
|
55
|
-
// Document type - single letter. Strict family set: OIML publishes
|
|
56
|
-
// R D B G E V S documents (the estate grammar's family letters);
|
|
57
|
-
// any other letter is a rejection, not a flavor.
|
|
58
|
-
rule("doc_type", () => match("[BDEGRSV]").as("type").then(ref(rules, "space")));
|
|
59
|
-
// Bulletin locator - structured YYYY[-II[-SS]]
|
|
60
|
-
rule("bulletin_date", () => ref(rules, "space")
|
|
61
|
-
.then(ref(rules, "year_digits").as("year"))
|
|
62
|
-
.then(ref(rules, "dash").then(ref(rules, "two_digits").as("issue")).maybe())
|
|
63
|
-
.then(ref(rules, "dash").then(ref(rules, "two_digits").as("sequence")).maybe()));
|
|
64
|
-
rule("two_digits", () => match("\\d").repeat(2, 2));
|
|
65
|
-
rule("roman_numeral", () => match("[IVXLCDM]").repeat(1).as("volume_roman"));
|
|
66
|
-
// Citation form: LXVII(2) 20260211
|
|
67
|
-
rule("bulletin_citation", () => ref(rules, "space")
|
|
68
|
-
.then(ref(rules, "roman_numeral"))
|
|
69
|
-
.then(ref(rules, "lparen"), ref(rules, "digits").as("issue_arabic"), ref(rules, "rparen"))
|
|
70
|
-
.then(str(" "), match("\\d").repeat(8, 8).as("article_id")));
|
|
71
|
-
rule("bulletin_identifier", () => ref(rules, "publisher")
|
|
72
|
-
.then(str("Bulletin").as("type"))
|
|
73
|
-
.then(ref(rules, "bulletin_citation").or(ref(rules, "bulletin_date")).maybe())
|
|
74
|
-
.then(ref(rules, "language_portion").maybe().as("language")));
|
|
75
|
-
rule("number_only", () => ref(rules, "digits").as("number"));
|
|
76
|
-
rule("part_number", () => ref(rules, "dash").then(ref(rules, "digits")
|
|
77
|
-
.then(ref(rules, "slash").then(ref(rules, "dash"), ref(rules, "digits")).repeat(0))
|
|
78
|
-
.as("part")));
|
|
79
|
-
rule("subpart_number", () => ref(rules, "dash").then(ref(rules, "digits").as("subpart")));
|
|
80
|
-
rule("named_suffix", () => ref(rules, "dash")
|
|
81
|
-
.then(str("GUM")
|
|
82
|
-
.then(ref(rules, "space"), ref(rules, "digits"))
|
|
83
|
-
.or(match("[A-Za-z]").repeat(1).then(str("_").maybe(), ref(rules, "digits")).repeat(0))
|
|
84
|
-
.as("code_suffix"))
|
|
85
|
-
.or(str(" ").then(str("Brochure").as("code_suffix"), str("").as("space_suffix"))));
|
|
86
|
-
rule("full_number", () => ref(rules, "number_only")
|
|
87
|
-
.then(ref(rules, "part_number"), ref(rules, "subpart_number"), ref(rules, "named_suffix").maybe())
|
|
88
|
-
.or(ref(rules, "number_only").then(ref(rules, "part_number"), ref(rules, "named_suffix").maybe()))
|
|
89
|
-
.or(ref(rules, "number_only").then(ref(rules, "named_suffix").maybe())));
|
|
90
|
-
rule("edition_number", () => str("6th")
|
|
91
|
-
.or(str("5th"))
|
|
92
|
-
.or(str("4th"))
|
|
93
|
-
.or(str("3rd"))
|
|
94
|
-
.or(str("2nd"))
|
|
95
|
-
.or(str("1st"))
|
|
96
|
-
.or(match("\\d").repeat(1).then(str("th").or(str("nd")).or(str("rd")).or(str("st"))))
|
|
97
|
-
.as("edition"));
|
|
98
|
-
rule("edition_text", () => str("Edition").or(str("edition")));
|
|
99
|
-
rule("edition_portion", () => str(", ")
|
|
100
|
-
.or(ref(rules, "space"))
|
|
101
|
-
.then(ref(rules, "edition_number").maybe(), ref(rules, "space?"), ref(rules, "edition_text"), ref(rules, "space?"), ref(rules, "year_digits").as("year"))
|
|
102
|
-
.as("edition_format"));
|
|
103
|
-
rule("date", () => ref(rules, "edition_portion")
|
|
104
|
-
// pubid#403: both sides of the colon are whitespace-tolerant
|
|
105
|
-
.or(ref(rules, "space?").then(ref(rules, "colon"), ref(rules, "space?"), ref(rules, "year_digits").as("year")))
|
|
106
|
-
.or(ref(rules, "space?").then(ref(rules, "lparen"), ref(rules, "year_digits").as("year"), ref(rules, "rparen"))));
|
|
107
|
-
rule("stage_iteration", () => match("\\d").repeat(1).then(str("."), match("\\d").repeat(1)).or(match("\\d").repeat(1)).as("iteration"));
|
|
108
|
-
rule("stage_abbr", () => str("WD").or(str("CD")).as("stage"));
|
|
109
|
-
rule("draft_stage", () => ref(rules, "space").then(ref(rules, "stage_iteration").maybe(), ref(rules, "stage_abbr")));
|
|
110
|
-
// Language codes: two-letter OIML codes before the single letters
|
|
111
|
-
rule("lang_single", () => match("[EFRXDSCAU]"));
|
|
112
|
-
rule("lang_multi_oiml", () => str("PO").or(str("PT")).or(str("PE")).or(str("SR")));
|
|
113
|
-
rule("lang_multi", () => match("[a-z]").repeat(2, 2));
|
|
114
|
-
// Full-word language markers as OIML prints them ("(Fra)", "(Eng)"),
|
|
115
|
-
// three or more letters, any case. Kept verbatim on the identifier;
|
|
116
|
-
// the URN lowercases.
|
|
117
|
-
rule("lang_word", () => match("[A-Za-z]").repeat(3));
|
|
118
|
-
rule("language_code", () => ref(rules, "lang_single")
|
|
119
|
-
.then(ref(rules, "slash"), ref(rules, "lang_single"))
|
|
120
|
-
.or(ref(rules, "lang_multi_oiml"))
|
|
121
|
-
.or(ref(rules, "lang_word"))
|
|
122
|
-
.or(ref(rules, "lang_single"))
|
|
123
|
-
.or(ref(rules, "lang_multi"))
|
|
124
|
-
.as("language"));
|
|
125
|
-
rule("language_with_space", () => ref(rules, "space")
|
|
126
|
-
.then(ref(rules, "lparen"), ref(rules, "language_code"), ref(rules, "rparen"))
|
|
127
|
-
.then(str("").as("space_before_lang")));
|
|
128
|
-
rule("language_without_space", () => ref(rules, "lparen").then(ref(rules, "language_code"), ref(rules, "rparen")));
|
|
129
|
-
rule("language_portion", () => ref(rules, "language_with_space").or(ref(rules, "language_without_space")));
|
|
130
|
-
// Amendment identifier - "Amendment (YYYY) to BASE"
|
|
131
|
-
rule("amendment_identifier", () => str("Amendment")
|
|
132
|
-
.then(ref(rules, "space"), ref(rules, "lparen"), ref(rules, "year_digits").as("year"), ref(rules, "rparen"))
|
|
133
|
-
.then(str(" "), str("to"), str(" "))
|
|
134
|
-
.then(ref(rules, "base_without_language").as("base"))
|
|
135
|
-
.then(ref(rules, "language_portion").maybe().as("language")));
|
|
136
|
-
rule("amendment_short", () => ref(rules, "publisher")
|
|
137
|
-
.then(ref(rules, "doc_type"))
|
|
138
|
-
.then(ref(rules, "full_number").as("base_code"))
|
|
139
|
-
.then(str(" "), str("Amendment").as("amd_marker"))
|
|
140
|
-
.then(str(" ")
|
|
141
|
-
.then(ref(rules, "edition_text"), ref(rules, "space?"), ref(rules, "year_digits").as("year"))
|
|
142
|
-
.as("edition_format")
|
|
143
|
-
.or(ref(rules, "colon").then(ref(rules, "space?"), ref(rules, "year_digits").as("year"))))
|
|
144
|
-
.then(ref(rules, "language_portion").maybe().as("language")));
|
|
145
|
-
rule("trailing_supplement_identifier", () => ref(rules, "base_without_language")
|
|
146
|
-
.as("base")
|
|
147
|
-
.then(str(" "), str("Amendment").or(str("Errata")).as("trailing_marker"))
|
|
148
|
-
.then(str(" ").then(ref(rules, "digits").as("number")).maybe(), ref(rules, "language_portion").maybe().as("language")));
|
|
149
|
-
// OIML-CS certification-system documents. Two head spellings
|
|
150
|
-
// ("OIML-CS" / "OIML CS") and two family-number separators
|
|
151
|
-
// ("PD-05" / "PD 05"), an "Edition N" instead of a year, and an
|
|
152
|
-
// optional parenthesized trailing amendment - "(Amendment 1)".
|
|
153
|
-
rule("cs_identifier", () => str("OIML")
|
|
154
|
-
.as("publisher")
|
|
155
|
-
.then(ref(rules, "dash")
|
|
156
|
-
.then(str("CS"))
|
|
157
|
-
.or(str(" ").then(str("CS")))
|
|
158
|
-
.as("cs_series"))
|
|
159
|
-
.then(ref(rules, "space"))
|
|
160
|
-
.then(str("PD").or(str("OD")).or(str("CID")).as("cs_family"))
|
|
161
|
-
.then(ref(rules, "dash").or(str(" ")).as("cs_separator"))
|
|
162
|
-
.then(ref(rules, "digits").as("number"))
|
|
163
|
-
.then(str(" "), str("Edition"), str(" "), ref(rules, "digits").as("edition"))
|
|
164
|
-
.then(str(" ")
|
|
165
|
-
.then(ref(rules, "lparen"), str("Amendment"), str(" "), ref(rules, "digits").as("cs_amendment"), ref(rules, "rparen"))
|
|
166
|
-
.maybe()));
|
|
167
|
-
rule("plus_supplement_identifier", () => ref(rules, "base_without_language")
|
|
168
|
-
.as("base")
|
|
169
|
-
.then(str("+"), str("Amendment").or(str("Errata")).as("plus_marker"))
|
|
170
|
-
.then(ref(rules, "colon").then(ref(rules, "year_digits").as("year")).maybe())
|
|
171
|
-
.then(ref(rules, "language_portion").maybe().as("language")));
|
|
172
|
-
rule("annex_identifier", () => ref(rules, "base_without_language")
|
|
173
|
-
.as("base")
|
|
174
|
-
.then(str(" "), str("Annexes").as("annex_marker"))
|
|
175
|
-
.then(str(" ")
|
|
176
|
-
.then(ref(rules, "edition_text"), str(" "), ref(rules, "year_digits").as("year"))
|
|
177
|
-
.as("edition_format")
|
|
178
|
-
.or(ref(rules, "colon").then(ref(rules, "year_digits").as("year")))
|
|
179
|
-
.maybe())
|
|
180
|
-
.then(ref(rules, "language_portion").maybe().as("language")));
|
|
181
|
-
rule("annex_letter_value", () => match("[A-Z]").then(ref(rules, "dash").then(match("[A-Z]")).maybe()).as("annex_letter"));
|
|
182
|
-
rule("annex_letter_identifier", () => ref(rules, "base_without_language")
|
|
183
|
-
.as("base")
|
|
184
|
-
.then(str(" "), str("Annex"), str(" "), ref(rules, "annex_letter_value"))
|
|
185
|
-
.then(str(" ")
|
|
186
|
-
.then(ref(rules, "edition_text"), str(" "), ref(rules, "year_digits").as("year"))
|
|
187
|
-
.or(ref(rules, "colon").then(ref(rules, "year_digits").as("year")))
|
|
188
|
-
.maybe())
|
|
189
|
-
.then(ref(rules, "language_portion").maybe().as("language")));
|
|
190
|
-
rule("base_without_language", () => ref(rules, "publisher")
|
|
191
|
-
.then(ref(rules, "doc_type"))
|
|
192
|
-
.then(ref(rules, "full_number"))
|
|
193
|
-
.then(ref(rules, "date").maybe())
|
|
194
|
-
.then(ref(rules, "draft_stage").maybe()));
|
|
195
|
-
rule("base", () => ref(rules, "publisher")
|
|
196
|
-
.then(ref(rules, "doc_type"))
|
|
197
|
-
.then(ref(rules, "full_number"))
|
|
198
|
-
.then(ref(rules, "date").maybe())
|
|
199
|
-
.then(ref(rules, "draft_stage").maybe())
|
|
200
|
-
.then(ref(rules, "language_portion").maybe()));
|
|
201
|
-
return rules;
|
|
202
|
-
}
|
|
203
|
-
export const oimlGrammar = {
|
|
204
|
-
rules: buildRules(),
|
|
205
|
-
root: "identifier",
|
|
206
|
-
};
|
package/vendor/parg/csv.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"bindings":null,"version":"1.0.0","grammar":"Csv","shape":"parsanol-tree/v2","binding_version":1,"entries":{"main":{"root":"file","grammar":{"atoms":[{"Entity":{"atom":28}},{"Entity":{"atom":21}},{"Entity":{"atom":13}},{"Entity":{"atom":4}},{"Re":{"pattern":"[\"]"}},{"Re":{"pattern":"[\\x00-\\x21]"}},{"Re":{"pattern":"[\\x23-\\u{10ffff}]"}},{"Entity":{"atom":4}},{"Entity":{"atom":4}},{"Sequence":{"atoms":[7,8]}},{"Alternative":{"atoms":[5,6,9]}},{"Repetition":{"atom":10,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":4}},{"Sequence":{"atoms":[3,11,12]}},{"Entity":{"atom":19}},{"Re":{"pattern":"[ !]"}},{"Re":{"pattern":"[\\x23-\\x2b]"}},{"Re":{"pattern":"[\\x2d-\\u{10ffff}]"}},{"Alternative":{"atoms":[15,16,17]}},{"Repetition":{"atom":18,"min":0,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[2,14]}},{"Named":{"name":"field","atom":20}},{"Entity":{"atom":23}},{"Re":{"pattern":"[,]"}},{"Entity":{"atom":21}},{"Sequence":{"atoms":[22,24]}},{"Repetition":{"atom":25,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[1,26]}},{"Named":{"name":"record","atom":27}},{"Entity":{"atom":36}},{"Entity":{"atom":33}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[31,32]}},{"Entity":{"atom":35}},{"Re":{"pattern":"[\\x0a]"}},{"Alternative":{"atoms":[30,34]}},{"Entity":{"atom":28}},{"Sequence":{"atoms":[29,37]}},{"Repetition":{"atom":38,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":36}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,39,41]}}],"root":42},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"main","render":{},"derive":{},"tests":[{"entry":"main","kind":"accept","input":"a,b,c","expect":{}},{"entry":"main","kind":"accept","input":"1,2\r\n3,4","expect":{}},{"entry":"main","kind":"accept","input":"1,2\n3,4","expect":{}},{"entry":"main","kind":"accept","input":"\"quoted,comma\",plain","expect":{}},{"entry":"main","kind":"accept","input":"\"say \"\"hi\"\"\",x","expect":{}},{"entry":"main","kind":"accept","input":"single","expect":{}},{"entry":"main","kind":"accept","input":"a,b,\r\n,,c","expect":{}},{"entry":"main","kind":"accept","input":"name,age\n\"Smith, John\",42\n\"multi\nline\",1","expect":{}},{"entry":"main","kind":"accept","input":"\"unicode ünïcödé\",2","expect":{}},{"entry":"main","kind":"accept","input":"row with trailing newline\n","expect":{}},{"entry":"main","kind":"accept","input":"a,b,\n","expect":{}},{"entry":"main","kind":"reject","input":"\"unterminated,x","expect":{}},{"entry":"main","kind":"reject","input":"a,\"mix\"ed","expect":{}},{"entry":"main","kind":"reject","input":"a,,b\rc","expect":{}},{"entry":"main","kind":"reject","input":"a\tb,c","expect":{}}],"docs":{"file":"file = record *( eol record ) [ eol ]; one record minimum (an\nempty document parses as one empty unquoted field).","eol":"eol: the RFC wire form is CRLF; bare LF tolerated.","quoted_field":"Quoted: dquote, any non-dquote bytes (CR/LF included — RFC allows\nline breaks inside quoted fields), or a doubled dquote escape.","unquoted_field":"Unquoted: RFC textdata (no dquote, comma, CR, LF) extended for\nmultibyte."},"source":"# CSV (RFC 4180): the delimited-data grammar — the second\n# general-purpose data-format flavor, riding the json flavor's\n# methodology (parsanol-rs#531 grammar breadth).\n#\n# Edition-2 notes: records are right-recursive through the row list\n# (no left recursion). Quoted fields admit any byte except a raw\n# dquote (dquotes double per RFC 4180 section 2.7); line breaks inside\n# quotes are legal RFC — the quoted class includes them. Unquoted\n# fields exclude dquote/comma/CR/LF (textdata, extended past 0x7E to\n# 0x10FFFF for UTF-8 content). Bare LF is accepted alongside CRLF\n# (editors rewrite line endings); a trailing row terminator is\n# optional. A trailing comma is a reject (RFC-strict: every comma\n# opens another field).\n\ngrammar Csv version \"1.0.0\" edition 2 {\n crlf = %x0D %x0A\n lf = %x0A\n comma = %x2C\n dquote = %x22\n\n ## file = record *( eol record ) [ eol ]; one record minimum (an\n ## empty document parses as one empty unquoted field).\n file = csv_record *( eol csv_record ) [ eol ]\n\n ## eol: the RFC wire form is CRLF; bare LF tolerated.\n eol = crlf / lf\n\n csv_record = ( field *( comma field ) ) as record\n field = ( quoted_field / unquoted_field ) as field\n\n ## Quoted: dquote, any non-dquote bytes (CR/LF included — RFC allows\n ## line breaks inside quoted fields), or a doubled dquote escape.\n quoted_field = dquote *( %x00-21 / %x23-10FFFF / dquote dquote ) dquote\n\n ## Unquoted: RFC textdata (no dquote, comma, CR, LF) extended for\n ## multibyte.\n unquoted_field = *( %x20-21 / %x23-2B / %x2D-10FFFF )\n\n entry main: file\n\n test {\n accept \"a,b,c\"\n accept \"1,2\\r\\n3,4\"\n accept \"1,2\\n3,4\"\n accept \"\\\"quoted,comma\\\",plain\"\n accept \"\\\"say \\\"\\\"hi\\\"\\\"\\\",x\"\n accept \"single\"\n accept \"a,b,\\r\\n,,c\"\n accept \"name,age\\n\\\"Smith, John\\\",42\\n\\\"multi\\nline\\\",1\"\n accept \"\\\"unicode ünïcödé\\\",2\"\n accept \"row with trailing newline\\n\"\n accept \"a,b,\\n\"\n reject \"\\\"unterminated,x\"\n reject \"a,\\\"mix\\\"ed\"\n reject \"a,,b\\rc\"\n reject \"a\\tb,c\"\n }\n}\n","source_hash":"bbdc83bc10785729575a5737a2215484e977ceccd21b0e93f0b462dbd4ad8583","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:66c57d7cd076087d38a0f19eca7edb55f02ea90eeb77fe5fc7ced17ce65f7fca","checksum":"sha256:33215bd625fe7e9a81aab93ebcb3e57c36b2305b0c2899a40f79daa97b4c9ea9","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":15,"tests_failures":0,"self_test":true}}
|
package/vendor/parg/ini.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"bindings":null,"version":"1.0.0","grammar":"Ini","shape":"parsanol-tree/v2","binding_version":1,"entries":{"main":{"root":"ini","grammar":{"atoms":[{"Entity":{"atom":15}},{"Entity":{"atom":5}},{"Re":{"pattern":"[ ]"}},{"Re":{"pattern":"[\\x09]"}},{"Alternative":{"atoms":[2,3]}},{"Repetition":{"atom":4,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":13}},{"Entity":{"atom":10}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[8,9]}},{"Entity":{"atom":12}},{"Re":{"pattern":"[\\x0a]"}},{"Alternative":{"atoms":[7,11]}},{"Sequence":{"atoms":[1,6]}},{"Named":{"name":"blank","atom":14}},{"Entity":{"atom":27}},{"Entity":{"atom":5}},{"Entity":{"atom":21}},{"Re":{"pattern":"[;]"}},{"Re":{"pattern":"[#]"}},{"Alternative":{"atoms":[19,20]}},{"Re":{"pattern":"[\\x20-\\u{10ffff}]"}},{"Repetition":{"atom":22,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":13}},{"Repetition":{"atom":24,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[17,18,23,25]}},{"Named":{"name":"comment","atom":26}},{"Entity":{"atom":49}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\[]"}},{"Entity":{"atom":5}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Re":{"pattern":"[\\x20-\\x22]"}},{"Re":{"pattern":"[\\x24-\\x39]"}},{"Re":{"pattern":"[<]"}},{"Re":{"pattern":"[\\x3e-\\x5a]"}},{"Re":{"pattern":"[\\\\]"}},{"Re":{"pattern":"[\\x5e-\\u{10ffff}]"}},{"Alternative":{"atoms":[34,35,36,37,38,39]}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"name","atom":41}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\]]"}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[29,30,31,32,43,44,45,47]}},{"Named":{"name":"section","atom":48}},{"Entity":{"atom":69}},{"Entity":{"atom":5}},{"Entity":{"atom":55}},{"Entity":{"atom":40}},{"Repetition":{"atom":53,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"key","atom":54}},{"Entity":{"atom":5}},{"Entity":{"atom":64}},{"Re":{"pattern":"[=]"}},{"Re":{"pattern":"[:]"}},{"Alternative":{"atoms":[58,59]}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x20-\\u{10ffff}]"}},{"Repetition":{"atom":62,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[60,61,63]}},{"Repetition":{"atom":57,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":13}},{"Repetition":{"atom":66,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[51,52,56,65,67]}},{"Named":{"name":"setting","atom":68}},{"Alternative":{"atoms":[0,16,28,50]}},{"Repetition":{"atom":70,"min":0,"max":null,"tag":"Repetition"}}],"root":71},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule name_char: branches 1 and 6 are order-dependent (first set not statically known)","rule name_char: branches 2 and 6 are order-dependent (first set not statically known)","rule name_char: branches 3 and 6 are order-dependent (first set not statically known)","rule name_char: branches 4 and 6 are order-dependent (first set not statically known)","rule name_char: branches 5 and 6 are order-dependent (first set not statically known)"]},"default_entry":"main","render":{},"derive":{},"tests":[{"entry":"main","kind":"accept","input":"[section]\nkey=value","expect":{}},{"entry":"main","kind":"accept","input":"key = value","expect":{}},{"entry":"main","kind":"accept","input":"a=1\nb:2\n;c\n#d\n[ s ]\nx=y","expect":{}},{"entry":"main","kind":"accept","input":"[a]\n[b]","expect":{}},{"entry":"main","kind":"accept","input":"empty=","expect":{}},{"entry":"main","kind":"accept","input":"; only a comment","expect":{}},{"entry":"main","kind":"accept","input":"key = value with; semicolon and # hash","expect":{}},{"entry":"main","kind":"accept","input":"flag\nother key = spaced","expect":{}},{"entry":"main","kind":"accept","input":"[top]\n\n[bottom]\nk = v\n","expect":{}},{"entry":"main","kind":"reject","input":"=novalue","expect":{}},{"entry":"main","kind":"reject","input":"[unclosed","expect":{}},{"entry":"main","kind":"reject","input":"a=b\n]stray","expect":{}},{"entry":"main","kind":"reject","input":"a=b\n = x","expect":{}}],"docs":{"ini":"ini = *( blank / comment / section / setting ); each line shape\nconsumes its own terminator, optional at end of document.","setting":"key = value or key: value — the separator tail is optional, so a\nbare key line (\"flag\") is a setting with an absent value.","name_char":"name chars: everything except CR/LF and the structural marks\n(= : [ ] ; #). Keys and section names share the class."},"source":"# INI: the classic configuration-file grammar — the third\n# general-purpose data-format flavor (parsanol-rs#531 grammar\n# breadth). The common INI denominator: optional sections, key=value\n# (or key:value), ; and # comments, values running to end of line.\n# Dialect notes: keys may contain spaces; a whitespace-only line is a\n# blank (ordered choice matches blank before setting); values keep\n# inline ; and # (inline comments are a dialect extension — not\n# consumed here). Line endings: CRLF or bare LF; the final line may\n# omit the terminator. An empty document parses (zero lines).\n\ngrammar Ini version \"1.0.0\" edition 2 {\n crlf = %x0D %x0A\n lf = %x0A\n ws = *( %x20 / %x09 )\n\n ## ini = *( blank / comment / section / setting ); each line shape\n ## consumes its own terminator, optional at end of document.\n ini = *( blank / comment / section / setting )\n\n blank = ( ws nl ) as blank\n\n comment = ( ws comment_mark *( %x20-10FFFF ) [ nl ] ) as comment\n comment_mark = %x3B / %x23\n\n section = ( ws %x5B ws section_name ws %x5D ws [ nl ] ) as section\n section_name = ( 1*name_char ) as name\n\n ## key = value or key: value — the separator tail is optional, so a\n ## bare key line (\"flag\") is a setting with an absent value.\n setting = ( ws key ws [ setting_tail ] [ nl ] ) as setting\n setting_tail = ( ( %x3D / %x3A ) ws *( %x20-10FFFF ) )\n key = ( 1*name_char ) as key\n\n ## name chars: everything except CR/LF and the structural marks\n ## (= : [ ] ; #). Keys and section names share the class.\n name_char = %x20-22 / %x24-39 / %x3C / %x3E-5A / %x5C / %x5E-10FFFF\n\n nl = crlf / lf\n\n entry main: ini\n\n test {\n accept \"[section]\\nkey=value\"\n accept \"key = value\"\n accept \"a=1\\nb:2\\n;c\\n#d\\n[ s ]\\nx=y\"\n accept \"[a]\\n[b]\"\n accept \"empty=\"\n accept \"; only a comment\"\n accept \"key = value with; semicolon and # hash\"\n accept \"flag\\nother key = spaced\"\n accept \"[top]\\n\\n[bottom]\\nk = v\\n\"\n reject \"=novalue\"\n reject \"[unclosed\"\n reject \"a=b\\n]stray\"\n reject \"a=b\\n = x\"\n }\n}\n","source_hash":"70a7b5c468797dd390971e31f462db71dde4ba0ce0b48887122a5824082f18be","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:9369ac09f2fba07c4c2c93f9240d604e8b4a66e70c8bf51b5c74f9b47418b810","checksum":"sha256:defd1de2f43d4b302df78854606cd220afe5ec8aed468b8f0def360aa78b86b3","validated":{"lint_errors":0,"lint_warnings":5,"tests_total":13,"tests_failures":0,"self_test":true}}
|