@pubid/pubid 0.1.70 → 0.1.72
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 +49 -1
- 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 +3 -4
- package/dist/flavors/bsi/index.js +16 -940
- package/dist/flavors/bsi/model.js +16 -0
- package/dist/flavors/bsi/worker.d.ts +3 -0
- package/dist/flavors/bsi/worker.js +25 -0
- 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 +4 -5
- package/dist/flavors/cen_cenelec/index.js +17 -281
- package/dist/flavors/cen_cenelec/model.js +16 -1
- package/dist/flavors/cen_cenelec/worker.d.ts +3 -0
- package/dist/flavors/cen_cenelec/worker.js +23 -0
- 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.d.ts +2 -1
- package/dist/flavors/csa/index.js +15 -633
- package/dist/flavors/csa/worker.d.ts +3 -0
- package/dist/flavors/csa/worker.js +23 -0
- 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 +2 -1
- package/dist/flavors/evs/index.js +15 -90
- package/dist/flavors/evs/worker.d.ts +3 -0
- package/dist/flavors/evs/worker.js +24 -0
- package/dist/flavors/foreign-resolver.d.ts +6 -0
- package/dist/flavors/foreign-resolver.js +9 -0
- 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.d.ts +2 -1
- package/dist/flavors/gost/index.js +15 -164
- package/dist/flavors/gost/worker.d.ts +3 -0
- package/dist/flavors/gost/worker.js +28 -0
- 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 +3 -0
- package/dist/flavors/ieee/preprocessor.js +10 -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 +8 -5
- 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.d.ts +13 -0
- package/dist/flavors/worker-registry.js +298 -0
- 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/model/identifier.d.ts +13 -1
- package/dist/model/identifier.js +71 -9
- 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.js +4 -2
- 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,392 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* WES (welding-engineering-standard, pubid#638) rides the same flavor:
|
|
16
|
-
* "WES <number>[-parts][:year[R]]…" with no series letter and no JIS
|
|
17
|
-
* prefix — the code itself carries the "WES" root. A WES id may also
|
|
18
|
-
* carry a TR/TS type after the root ("WES TR 2032:2024", its own
|
|
19
|
-
* welding-engineering-technical-report/-specification classes,
|
|
20
|
-
* pubid#716) and a language before the year ("WES 1112(E):2022",
|
|
21
|
-
* bound only when a colon follows; recorded as language_before_year,
|
|
22
|
-
* which equality ignores — the two (E) positions are one document).
|
|
23
|
-
*/
|
|
24
|
-
function buildRules() {
|
|
25
|
-
const rules = {};
|
|
26
|
-
const rule = (name, build) => {
|
|
27
|
-
rules[name] = build();
|
|
28
|
-
};
|
|
29
|
-
const jpDash = str("ー");
|
|
30
|
-
const jpSpace = str(" ");
|
|
31
|
-
const jpColon = str(":");
|
|
32
|
-
const jpLparen = str("(");
|
|
33
|
-
const jpRparen = str(")");
|
|
34
|
-
const space = str(" ").or(jpSpace);
|
|
35
|
-
const dash = str("-").or(jpDash);
|
|
36
|
-
const colon = str(":").or(jpColon);
|
|
37
|
-
const digits = match("[0-9]").repeat(1, Infinity);
|
|
38
|
-
rule("jis_prefix", () => str("JIS").then(space.or(str("/")).maybe()));
|
|
39
|
-
rule("type_prefix", () => (str("TR").or(str("TS"))).as("type").then(space.or(str("/"))));
|
|
40
|
-
rule("series", () => match("[A-Z]").as("series"));
|
|
41
|
-
rule("number", () => digits.as("number"));
|
|
42
|
-
rule("part", () => dash.then(digits.as("part")));
|
|
43
|
-
rule("parts", () => rules["part"].repeat(0, Infinity).as("parts"));
|
|
44
|
-
rule("reaffirmed", () => str("R").maybe().as("reaffirmed"));
|
|
45
|
-
rule("year", () => colon.then(digits.as("year"), rules["reaffirmed"]));
|
|
46
|
-
rule("language", () => jpLparen.or(str("(")).then(match("[EJ]").as("language"), jpRparen.or(str(")"))));
|
|
47
|
-
rule("all_parts", () => jpLparen.then(str("規格群"), jpRparen)
|
|
48
|
-
.or(str("(").then(str("規格群"), str(")")))
|
|
49
|
-
.as("all_parts"));
|
|
50
|
-
rule("amendment", () => str("/").then((str("AMENDMENT").or(str("AMD"))).as("amd_type"), space, digits.as("amd_number"), colon, digits.as("amd_year"), str("R").maybe().as("amd_reaffirmed")));
|
|
51
|
-
rule("explanation", () => str("/").then((str("EXPLANATION").or(str("EXPL"))).as("expl_type"), space.then(digits.as("expl_number")).maybe()));
|
|
52
|
-
rule("corrigendum", () => str("/").then((str("CORRIGENDUM").or(str("CORR"))).as("corr_type"), space, digits.as("corr_number"), colon, digits.as("corr_year"), str("R").maybe().as("corr_reaffirmed")));
|
|
53
|
-
rule("supplement", () => rules["amendment"].as("amendment")
|
|
54
|
-
.or(rules["explanation"].as("explanation"))
|
|
55
|
-
.or(rules["corrigendum"].as("corrigendum")));
|
|
56
|
-
rule("symbol_clause", () => space.then(str("SYMBOL").as("symbol_present"), space.then(match("[^\\n]").repeat(1, Infinity).as("symbol_value")).maybe()));
|
|
57
|
-
rule("identifier", () => rules["jis_prefix"]
|
|
58
|
-
.maybe()
|
|
59
|
-
.then(rules["type_prefix"].maybe())
|
|
60
|
-
.then(space.maybe(), rules["series"], space.maybe(), rules["number"])
|
|
61
|
-
.then(rules["parts"])
|
|
62
|
-
.then(rules["year"].maybe())
|
|
63
|
-
.then(rules["language"].maybe())
|
|
64
|
-
.then(rules["all_parts"].maybe())
|
|
65
|
-
.then(rules["supplement"].maybe())
|
|
66
|
-
.then(rules["symbol_clause"].maybe()));
|
|
67
|
-
// WES (Japan Welding Engineering Society) rides the JIS flavor with the
|
|
68
|
-
// same tail but no prefix and no series letter; the root tries it first,
|
|
69
|
-
// as the reference grammar does. A WES id may also carry a TR/TS type
|
|
70
|
-
// after the root ("WES TR 2032:2024") and a language before the year
|
|
71
|
-
// ("WES 1112(E):2022" — bound only when a colon follows, so
|
|
72
|
-
// "WES 1112(E)" with no year still reads as no language).
|
|
73
|
-
rule("wes_type", () => (str("TR").or(str("TS"))).as("wes_type").then(space));
|
|
74
|
-
rule("wes_language", () => jpLparen.or(str("(")).then(match("[EJ]").as("wes_language"), jpRparen.or(str(")"))).then(colon.present()));
|
|
75
|
-
rule("wes_identifier", () => str("WES").as("wes")
|
|
76
|
-
.then(space)
|
|
77
|
-
.then(rules["wes_type"].maybe())
|
|
78
|
-
.then(rules["number"])
|
|
79
|
-
.then(rules["parts"])
|
|
80
|
-
.then(rules["wes_language"].maybe())
|
|
81
|
-
.then(rules["year"].maybe())
|
|
82
|
-
.then(rules["language"].maybe())
|
|
83
|
-
.then(rules["all_parts"].maybe())
|
|
84
|
-
.then(rules["supplement"].maybe())
|
|
85
|
-
.then(rules["symbol_clause"].maybe()));
|
|
86
|
-
rule("root", () => rules["wes_identifier"].or(rules["identifier"]));
|
|
87
|
-
return rules;
|
|
88
|
-
}
|
|
89
|
-
export const jisGrammar = { rules: buildRules(), root: "root" };
|
|
90
|
-
const KIND_PREFIXES = {
|
|
91
|
-
"japanese-industrial-standard": undefined,
|
|
92
|
-
"technical-report": "TR",
|
|
93
|
-
"technical-specification": "TS",
|
|
94
|
-
};
|
|
95
|
-
class JisIdentifier extends BaseIdentifier {
|
|
96
|
-
// The bare SYMBOL face (`symbol: ""`, rendered "…SYMBOL") and the
|
|
97
|
-
// no-symbol face (`symbol` undefined) are distinct states of a
|
|
98
|
-
// two-valued attribute — the match is absolute equality, blank-vs-blank
|
|
99
|
-
// included (the gem's subset_attribute_match? override, pubid main
|
|
100
|
-
// ef8f041c / 2.0.45). Declared exact-blank rather than strict: the
|
|
101
|
-
// strict nil≈empty shortcut is exactly the tolerance this law rejects,
|
|
102
|
-
// and the gem likewise routes :symbol before both strict and value
|
|
103
|
-
// matching.
|
|
104
|
-
static subsetExactBlanks = ["symbol"];
|
|
105
|
-
/** The rendered document code, e.g. "B 0205-1". */
|
|
106
|
-
code() {
|
|
107
|
-
if (this.base !== undefined)
|
|
108
|
-
return this.base.code();
|
|
109
|
-
if (this.series === undefined || this.number === undefined)
|
|
110
|
-
return undefined;
|
|
111
|
-
let result = `${this.series} ${this.number}`;
|
|
112
|
-
if (this.parts !== undefined)
|
|
113
|
-
result += this.parts.map((p) => `-${p}`).join("");
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
yearWithReaffirmation() {
|
|
117
|
-
return `${this.year}${this.reaffirmed === true ? "R" : ""}`;
|
|
118
|
-
}
|
|
119
|
-
/** The ":year[R]" and "(lang)" tail, in the order the source used
|
|
120
|
-
* (ruby year_and_language). */
|
|
121
|
-
yearAndLanguage() {
|
|
122
|
-
const yearPart = this.year !== undefined ? `:${this.yearWithReaffirmation()}` : "";
|
|
123
|
-
const langPart = this.language !== undefined ? `(${this.language})` : "";
|
|
124
|
-
return this.language_before_year === true ? langPart + yearPart : yearPart + langPart;
|
|
125
|
-
}
|
|
126
|
-
symbolSuffix() {
|
|
127
|
-
if (this.symbol === undefined)
|
|
128
|
-
return "";
|
|
129
|
-
return this.symbol === "" ? " SYMBOL" : ` SYMBOL ${this.symbol}`;
|
|
130
|
-
}
|
|
131
|
-
supplementNotation() {
|
|
132
|
-
return "";
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
const JIS_MAPPINGS = keyValue({ wire: "series", to: "series" }, { wire: "number", to: "number" }, { wire: "parts", to: "parts" }, { wire: "year", to: "year" }, { wire: "language", to: "language" }, { wire: "language_before_year", to: "language_before_year" }, { wire: "all_parts", to: "all_parts" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "symbol", to: "symbol" });
|
|
136
|
-
function jisClass(kind) {
|
|
137
|
-
const isSupplement = kind === "amendment" || kind === "corrigendum" || kind === "explanation";
|
|
138
|
-
class JisKindIdentifier extends JisIdentifier {
|
|
139
|
-
static polymorphicName = `pubid:jis:${kind}`;
|
|
140
|
-
static attributes = isSupplement
|
|
141
|
-
? extendAttributes(BaseIdentifier, {
|
|
142
|
-
base: { type: JisIdentifier },
|
|
143
|
-
number: { type: "integer" },
|
|
144
|
-
year: { type: "integer" },
|
|
145
|
-
reaffirmed: { type: "boolean" },
|
|
146
|
-
})
|
|
147
|
-
: extendAttributes(BaseIdentifier, {
|
|
148
|
-
series: { type: "string" },
|
|
149
|
-
number: { type: "string" },
|
|
150
|
-
parts: { type: "string", collection: true },
|
|
151
|
-
year: { type: "integer" },
|
|
152
|
-
language: { type: "string" },
|
|
153
|
-
language_before_year: { type: "boolean", equalityIgnored: true },
|
|
154
|
-
all_parts: { type: "boolean", default: false },
|
|
155
|
-
reaffirmed: { type: "boolean" },
|
|
156
|
-
symbol: { type: "string" },
|
|
157
|
-
});
|
|
158
|
-
static mappings = isSupplement
|
|
159
|
-
? keyValue({ wire: "number", to: "number" }, { wire: "year", to: "year" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "base", to: "base" })
|
|
160
|
-
: JIS_MAPPINGS;
|
|
161
|
-
render() {
|
|
162
|
-
if (isSupplement) {
|
|
163
|
-
const result = `${this.base?.render() ?? ""}/${this.supplementNotation()}`;
|
|
164
|
-
return result + this.symbolSuffix();
|
|
165
|
-
}
|
|
166
|
-
const typePrefix = KIND_PREFIXES[kind];
|
|
167
|
-
let result = typePrefix === undefined ? "JIS" : `JIS ${typePrefix}`;
|
|
168
|
-
result += ` ${this.code()}`;
|
|
169
|
-
result += this.yearAndLanguage();
|
|
170
|
-
if (this.all_parts === true)
|
|
171
|
-
result += "(規格群)";
|
|
172
|
-
return result + this.symbolSuffix();
|
|
173
|
-
}
|
|
174
|
-
supplementNotation() {
|
|
175
|
-
if (kind === "amendment")
|
|
176
|
-
return `AMD ${this.number}:${this.yearWithReaffirmation()}`;
|
|
177
|
-
if (kind === "corrigendum")
|
|
178
|
-
return `CORRIGENDUM ${this.number}:${this.yearWithReaffirmation()}`;
|
|
179
|
-
if (kind === "explanation") {
|
|
180
|
-
return this.number === undefined ? "EXPL" : `EXPL ${this.number}`;
|
|
181
|
-
}
|
|
182
|
-
return "";
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
registerType(JisKindIdentifier);
|
|
186
|
-
return JisKindIdentifier;
|
|
187
|
-
}
|
|
188
|
-
const KIND_CLASSES = {
|
|
189
|
-
"japanese-industrial-standard": jisClass("japanese-industrial-standard"),
|
|
190
|
-
"technical-report": jisClass("technical-report"),
|
|
191
|
-
"technical-specification": jisClass("technical-specification"),
|
|
192
|
-
amendment: jisClass("amendment"),
|
|
193
|
-
corrigendum: jisClass("corrigendum"),
|
|
194
|
-
explanation: jisClass("explanation"),
|
|
195
|
-
};
|
|
196
|
-
const WES_TYPE_PREFIXES = {
|
|
197
|
-
"welding-engineering-standard": undefined,
|
|
198
|
-
"welding-engineering-technical-report": "TR",
|
|
199
|
-
"welding-engineering-technical-specification": "TS",
|
|
200
|
-
};
|
|
201
|
-
// WES 7700-1:2019 — JSA sells Welding Engineering Standards next to JIS,
|
|
202
|
-
// so they parse through the JIS flavor, but the id carries no series
|
|
203
|
-
// letter and no JIS prefix ("WES" is the root of the designation). The
|
|
204
|
-
// TR/TS type token after the root picks the WES TR / WES TS classes
|
|
205
|
-
// (pubid#716): "WES TR 2032" is not "WES 2032" and not "TR Z 2032".
|
|
206
|
-
function wesClass(kind) {
|
|
207
|
-
class JisWesIdentifier extends JisIdentifier {
|
|
208
|
-
static polymorphicName = `pubid:jis:${kind}`;
|
|
209
|
-
static attributes = extendAttributes(BaseIdentifier, {
|
|
210
|
-
number: { type: "string" },
|
|
211
|
-
parts: { type: "string", collection: true },
|
|
212
|
-
year: { type: "integer" },
|
|
213
|
-
language: { type: "string" },
|
|
214
|
-
language_before_year: { type: "boolean", equalityIgnored: true },
|
|
215
|
-
all_parts: { type: "boolean", default: false },
|
|
216
|
-
reaffirmed: { type: "boolean" },
|
|
217
|
-
symbol: { type: "string" },
|
|
218
|
-
});
|
|
219
|
-
static mappings = keyValue({ wire: "number", to: "number" }, { wire: "parts", to: "parts" }, { wire: "year", to: "year" }, { wire: "language", to: "language" }, { wire: "language_before_year", to: "language_before_year" }, { wire: "all_parts", to: "all_parts" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "symbol", to: "symbol" });
|
|
220
|
-
code() {
|
|
221
|
-
if (this.base !== undefined)
|
|
222
|
-
return this.base.code();
|
|
223
|
-
const prefix = WES_TYPE_PREFIXES[kind];
|
|
224
|
-
const root = prefix === undefined ? "WES" : `WES ${prefix}`;
|
|
225
|
-
let result = `${root} ${this.number}`;
|
|
226
|
-
if (this.parts !== undefined)
|
|
227
|
-
result += this.parts.map((p) => `-${p}`).join("");
|
|
228
|
-
return result;
|
|
229
|
-
}
|
|
230
|
-
render() {
|
|
231
|
-
let result = this.code() ?? "";
|
|
232
|
-
result += this.yearAndLanguage();
|
|
233
|
-
if (this.all_parts === true)
|
|
234
|
-
result += "(規格群)";
|
|
235
|
-
return result + this.symbolSuffix();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
registerType(JisWesIdentifier);
|
|
239
|
-
return JisWesIdentifier;
|
|
240
|
-
}
|
|
241
|
-
const WES_CLASSES = {
|
|
242
|
-
"welding-engineering-standard": wesClass("welding-engineering-standard"),
|
|
243
|
-
"welding-engineering-technical-report": wesClass("welding-engineering-technical-report"),
|
|
244
|
-
"welding-engineering-technical-specification": wesClass("welding-engineering-technical-specification"),
|
|
245
|
-
};
|
|
246
|
-
class JisUrnGenerator extends BaseUrnGenerator {
|
|
247
|
-
generate() {
|
|
248
|
-
const id = this.identifier;
|
|
249
|
-
const parts = ["urn", "jis"];
|
|
250
|
-
const code = id.code();
|
|
251
|
-
if (code !== undefined)
|
|
252
|
-
parts.push(code);
|
|
253
|
-
if (id.year !== undefined)
|
|
254
|
-
parts.push(String(id.year));
|
|
255
|
-
if (id.language !== undefined)
|
|
256
|
-
parts.push(id.language.toLowerCase());
|
|
257
|
-
if (id.all_parts === true)
|
|
258
|
-
parts.push("all");
|
|
259
|
-
const notation = id.supplementNotation();
|
|
260
|
-
if (id.base !== undefined && notation !== "") {
|
|
261
|
-
parts.push(notation.toLowerCase());
|
|
262
|
-
}
|
|
263
|
-
return parts.join(":");
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
for (const klass of [...Object.values(KIND_CLASSES), ...Object.values(WES_CLASSES)]) {
|
|
267
|
-
klass.urnGenerator = JisUrnGenerator;
|
|
268
|
-
}
|
|
269
|
-
function isObj(v) {
|
|
270
|
-
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
271
|
-
}
|
|
272
|
-
function extractParts(raw) {
|
|
273
|
-
if (Array.isArray(raw)) {
|
|
274
|
-
return raw.map((p) => (isObj(p) ? String(p["part"]) : String(p)));
|
|
275
|
-
}
|
|
276
|
-
if (isObj(raw) && raw["part"] !== undefined)
|
|
277
|
-
return [String(raw["part"])];
|
|
278
|
-
return [];
|
|
279
|
-
}
|
|
280
|
-
class JisBuilder {
|
|
281
|
-
build(data) {
|
|
282
|
-
const tree = (Array.isArray(data) ? Object.assign({}, ...data) : data);
|
|
283
|
-
const identifier = this.dispatch(tree);
|
|
284
|
-
// The SYMBOL clause attaches to the outermost identifier.
|
|
285
|
-
if (tree["symbol_present"] !== undefined) {
|
|
286
|
-
identifier["symbol"] =
|
|
287
|
-
tree["symbol_value"] === undefined || tree["symbol_value"] === null
|
|
288
|
-
? ""
|
|
289
|
-
: String(tree["symbol_value"]);
|
|
290
|
-
}
|
|
291
|
-
return identifier;
|
|
292
|
-
}
|
|
293
|
-
dispatch(tree) {
|
|
294
|
-
if (tree["amendment"] !== undefined)
|
|
295
|
-
return this.buildSupplement(tree, "amendment", "amendment", "amd");
|
|
296
|
-
if (tree["corrigendum"] !== undefined)
|
|
297
|
-
return this.buildSupplement(tree, "corrigendum", "corrigendum", "corr");
|
|
298
|
-
if (tree["explanation"] !== undefined)
|
|
299
|
-
return this.buildExplanation(tree);
|
|
300
|
-
return this.buildSingle(tree);
|
|
301
|
-
}
|
|
302
|
-
baseData(tree, key) {
|
|
303
|
-
const out = { ...tree };
|
|
304
|
-
delete out[key];
|
|
305
|
-
return out;
|
|
306
|
-
}
|
|
307
|
-
buildSingle(tree) {
|
|
308
|
-
if (tree["wes"] !== undefined)
|
|
309
|
-
return this.buildWes(tree);
|
|
310
|
-
const type = tree["type"] === undefined || tree["type"] === null ? undefined : String(tree["type"]);
|
|
311
|
-
const kind = type === "TR" ? "technical-report" : type === "TS" ? "technical-specification" : "japanese-industrial-standard";
|
|
312
|
-
const attrs = {
|
|
313
|
-
series: String(tree["series"]),
|
|
314
|
-
number: String(tree["number"]),
|
|
315
|
-
parts: extractParts(tree["parts"]),
|
|
316
|
-
};
|
|
317
|
-
if (tree["year"] !== undefined && tree["year"] !== null)
|
|
318
|
-
attrs["year"] = Number(tree["year"]);
|
|
319
|
-
if (tree["language"] !== undefined && tree["language"] !== null)
|
|
320
|
-
attrs["language"] = String(tree["language"]);
|
|
321
|
-
if (tree["all_parts"] !== undefined)
|
|
322
|
-
attrs["all_parts"] = true;
|
|
323
|
-
if (tree["reaffirmed"] !== undefined && tree["reaffirmed"] !== null)
|
|
324
|
-
attrs["reaffirmed"] = true;
|
|
325
|
-
return new KIND_CLASSES[kind](attrs);
|
|
326
|
-
}
|
|
327
|
-
buildWes(tree) {
|
|
328
|
-
const attrs = {
|
|
329
|
-
number: String(tree["number"]),
|
|
330
|
-
parts: extractParts(tree["parts"]),
|
|
331
|
-
};
|
|
332
|
-
if (tree["year"] !== undefined && tree["year"] !== null)
|
|
333
|
-
attrs["year"] = Number(tree["year"]);
|
|
334
|
-
const wesType = tree["wes_type"] === undefined || tree["wes_type"] === null ? undefined : String(tree["wes_type"]);
|
|
335
|
-
const kind = wesType === "TR"
|
|
336
|
-
? "welding-engineering-technical-report"
|
|
337
|
-
: wesType === "TS"
|
|
338
|
-
? "welding-engineering-technical-specification"
|
|
339
|
-
: "welding-engineering-standard";
|
|
340
|
-
// "wes_language" is a language printed before the year
|
|
341
|
-
// ("WES 1112(E):2022"); an id carries one language, not two.
|
|
342
|
-
if (tree["wes_language"] !== undefined && tree["wes_language"] !== null) {
|
|
343
|
-
if (tree["language"] !== undefined && tree["language"] !== null) {
|
|
344
|
-
throw new ParseFailed("JIS: a WES id carries one language, not two", 0);
|
|
345
|
-
}
|
|
346
|
-
attrs["language"] = String(tree["wes_language"]);
|
|
347
|
-
attrs["language_before_year"] = true;
|
|
348
|
-
}
|
|
349
|
-
else if (tree["language"] !== undefined && tree["language"] !== null) {
|
|
350
|
-
attrs["language"] = String(tree["language"]);
|
|
351
|
-
}
|
|
352
|
-
if (tree["all_parts"] !== undefined)
|
|
353
|
-
attrs["all_parts"] = true;
|
|
354
|
-
if (tree["reaffirmed"] !== undefined && tree["reaffirmed"] !== null)
|
|
355
|
-
attrs["reaffirmed"] = true;
|
|
356
|
-
return new WES_CLASSES[kind](attrs);
|
|
357
|
-
}
|
|
358
|
-
buildSupplement(tree, kind, key, prefix) {
|
|
359
|
-
const supp = isObj(tree[key]) ? tree[key] : {};
|
|
360
|
-
const base = this.buildSingle(this.baseData(tree, key));
|
|
361
|
-
const attrs = {
|
|
362
|
-
base,
|
|
363
|
-
number: Number(supp[`${prefix}_number`]),
|
|
364
|
-
year: Number(supp[`${prefix}_year`]),
|
|
365
|
-
};
|
|
366
|
-
if (supp[`${prefix}_reaffirmed`] !== undefined && supp[`${prefix}_reaffirmed`] !== null) {
|
|
367
|
-
attrs["reaffirmed"] = true;
|
|
368
|
-
}
|
|
369
|
-
return new KIND_CLASSES[kind](attrs);
|
|
370
|
-
}
|
|
371
|
-
buildExplanation(tree) {
|
|
372
|
-
const supp = isObj(tree["explanation"]) ? tree["explanation"] : {};
|
|
373
|
-
const base = this.buildSingle(this.baseData(tree, "explanation"));
|
|
374
|
-
const attrs = { base, year: base.year };
|
|
375
|
-
if (supp["expl_number"] !== undefined && supp["expl_number"] !== null) {
|
|
376
|
-
attrs["number"] = Number(supp["expl_number"]);
|
|
377
|
-
}
|
|
378
|
-
return new KIND_CLASSES["explanation"](attrs);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
1
|
+
//! The jis node entry: the parse lane is the GENERATED substrate
|
|
2
|
+
//! (pubid/pubid-grammar#164) driving the wasm artifact runtime - the
|
|
3
|
+
//! baked jis.json is the only parsing input. The hand grammar
|
|
4
|
+
//! re-transcription retired from this lane. The semantic delta lives in
|
|
5
|
+
//! implementation.ts (the builder dispatch) and model.ts (the classes),
|
|
6
|
+
//! shared byte for byte with the worker entry.
|
|
7
|
+
import { PubidRuntime } from "../../parg/runtime.js";
|
|
8
|
+
import * as substrate from "./generated/substrate.js";
|
|
9
|
+
import { makeJisGrammarImplementation } from "./implementation.js";
|
|
10
|
+
// The generated substrate drives the wasm artifact runtime - registered
|
|
11
|
+
// once at module init. Node-only (the runtime walks to the artifacts
|
|
12
|
+
// through node:fs); the worker entry registers the pure-TS worker
|
|
13
|
+
// engine instead.
|
|
14
|
+
substrate.registerRuntime(() => PubidRuntime.load(substrate.FLAVOR, substrate.ENTRY));
|
|
381
15
|
export function jisGrammarImplementation() {
|
|
382
|
-
|
|
383
|
-
return {
|
|
384
|
-
parse(input) {
|
|
385
|
-
const tree = parseGrammar(jisGrammar, input);
|
|
386
|
-
if (typeof tree !== "object" || tree === null) {
|
|
387
|
-
throw new ParseFailed("JIS: unexpected parse tree", 0);
|
|
388
|
-
}
|
|
389
|
-
return builder.build(tree);
|
|
390
|
-
},
|
|
391
|
-
};
|
|
16
|
+
return makeJisGrammarImplementation((body) => substrate.boundToWire(substrate.parseBound(body)));
|
|
392
17
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Tree, TreeObject } from "../../grammar/engine.js";
|
|
2
|
+
import { BaseIdentifier } from "../../model/identifier.js";
|
|
3
|
+
import type { IdentifierStatic } from "../../model/identifier.js";
|
|
4
|
+
export type JisKind = "japanese-industrial-standard" | "technical-report" | "technical-specification" | "amendment" | "corrigendum" | "explanation";
|
|
5
|
+
export declare abstract class JisIdentifier extends BaseIdentifier {
|
|
6
|
+
static subsetExactBlanks: string[];
|
|
7
|
+
readonly series: string | undefined;
|
|
8
|
+
readonly number: number | string | undefined;
|
|
9
|
+
readonly parts: string[] | undefined;
|
|
10
|
+
readonly year: number | undefined;
|
|
11
|
+
readonly language: string | undefined;
|
|
12
|
+
readonly language_before_year: boolean | undefined;
|
|
13
|
+
readonly all_parts: boolean | undefined;
|
|
14
|
+
readonly reaffirmed: boolean | undefined;
|
|
15
|
+
readonly symbol: string | undefined;
|
|
16
|
+
readonly base: JisIdentifier | undefined;
|
|
17
|
+
/** The rendered document code, e.g. "B 0205-1". */
|
|
18
|
+
code(): string | undefined;
|
|
19
|
+
yearWithReaffirmation(): string;
|
|
20
|
+
/** The ":year[R]" and "(lang)" tail, in the order the source used
|
|
21
|
+
* (ruby year_and_language). */
|
|
22
|
+
yearAndLanguage(): string;
|
|
23
|
+
symbolSuffix(): string;
|
|
24
|
+
supplementNotation(): string;
|
|
25
|
+
}
|
|
26
|
+
export declare const KIND_CLASSES: Record<JisKind, IdentifierStatic>;
|
|
27
|
+
export type WesKind = "welding-engineering-standard" | "welding-engineering-technical-report" | "welding-engineering-technical-specification";
|
|
28
|
+
export declare const WES_CLASSES: Record<WesKind, IdentifierStatic>;
|
|
29
|
+
export declare function isObj(v: Tree): v is TreeObject;
|
|
30
|
+
export declare function extractParts(raw: Tree): string[];
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
//! The jis model: the identifier classes, the URN generator and the
|
|
2
|
+
//! part extractor — the semantic delta the builder and both entries
|
|
3
|
+
//! share (the parse lane is the generated substrate,
|
|
4
|
+
//! pubid/pubid-grammar#164).
|
|
5
|
+
import { BaseIdentifier, registerType } from "../../model/identifier.js";
|
|
6
|
+
import { extendAttributes, keyValue } from "../../model/attribute.js";
|
|
7
|
+
import { BaseUrnGenerator } from "../../model/urn-generator.js";
|
|
8
|
+
const KIND_PREFIXES = {
|
|
9
|
+
"japanese-industrial-standard": undefined,
|
|
10
|
+
"technical-report": "TR",
|
|
11
|
+
"technical-specification": "TS",
|
|
12
|
+
};
|
|
13
|
+
export class JisIdentifier extends BaseIdentifier {
|
|
14
|
+
// The bare SYMBOL face (`symbol: ""`, rendered "…SYMBOL") and the
|
|
15
|
+
// no-symbol face (`symbol` undefined) are distinct states of a
|
|
16
|
+
// two-valued attribute — the match is absolute equality, blank-vs-blank
|
|
17
|
+
// included (the gem's subset_attribute_match? override, pubid main
|
|
18
|
+
// ef8f041c / 2.0.45). Declared exact-blank rather than strict: the
|
|
19
|
+
// strict nil≈empty shortcut is exactly the tolerance this law rejects,
|
|
20
|
+
// and the gem likewise routes :symbol before both strict and value
|
|
21
|
+
// matching.
|
|
22
|
+
static subsetExactBlanks = ["symbol"];
|
|
23
|
+
/** The rendered document code, e.g. "B 0205-1". */
|
|
24
|
+
code() {
|
|
25
|
+
if (this.base !== undefined)
|
|
26
|
+
return this.base.code();
|
|
27
|
+
if (this.series === undefined || this.number === undefined)
|
|
28
|
+
return undefined;
|
|
29
|
+
let result = `${this.series} ${this.number}`;
|
|
30
|
+
if (this.parts !== undefined)
|
|
31
|
+
result += this.parts.map((p) => `-${p}`).join("");
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
yearWithReaffirmation() {
|
|
35
|
+
return `${this.year}${this.reaffirmed === true ? "R" : ""}`;
|
|
36
|
+
}
|
|
37
|
+
/** The ":year[R]" and "(lang)" tail, in the order the source used
|
|
38
|
+
* (ruby year_and_language). */
|
|
39
|
+
yearAndLanguage() {
|
|
40
|
+
const yearPart = this.year !== undefined ? `:${this.yearWithReaffirmation()}` : "";
|
|
41
|
+
const langPart = this.language !== undefined ? `(${this.language})` : "";
|
|
42
|
+
return this.language_before_year === true ? langPart + yearPart : yearPart + langPart;
|
|
43
|
+
}
|
|
44
|
+
symbolSuffix() {
|
|
45
|
+
if (this.symbol === undefined)
|
|
46
|
+
return "";
|
|
47
|
+
return this.symbol === "" ? " SYMBOL" : ` SYMBOL ${this.symbol}`;
|
|
48
|
+
}
|
|
49
|
+
supplementNotation() {
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const JIS_MAPPINGS = keyValue({ wire: "series", to: "series" }, { wire: "number", to: "number" }, { wire: "parts", to: "parts" }, { wire: "year", to: "year" }, { wire: "language", to: "language" }, { wire: "language_before_year", to: "language_before_year" }, { wire: "all_parts", to: "all_parts" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "symbol", to: "symbol" });
|
|
54
|
+
function jisClass(kind) {
|
|
55
|
+
const isSupplement = kind === "amendment" || kind === "corrigendum" || kind === "explanation";
|
|
56
|
+
class JisKindIdentifier extends JisIdentifier {
|
|
57
|
+
static polymorphicName = `pubid:jis:${kind}`;
|
|
58
|
+
static attributes = isSupplement
|
|
59
|
+
? extendAttributes(BaseIdentifier, {
|
|
60
|
+
base: { type: JisIdentifier },
|
|
61
|
+
number: { type: "integer" },
|
|
62
|
+
year: { type: "integer" },
|
|
63
|
+
reaffirmed: { type: "boolean" },
|
|
64
|
+
})
|
|
65
|
+
: extendAttributes(BaseIdentifier, {
|
|
66
|
+
series: { type: "string" },
|
|
67
|
+
number: { type: "string" },
|
|
68
|
+
parts: { type: "string", collection: true },
|
|
69
|
+
year: { type: "integer" },
|
|
70
|
+
language: { type: "string" },
|
|
71
|
+
language_before_year: { type: "boolean", equalityIgnored: true },
|
|
72
|
+
all_parts: { type: "boolean", default: false },
|
|
73
|
+
reaffirmed: { type: "boolean" },
|
|
74
|
+
symbol: { type: "string" },
|
|
75
|
+
});
|
|
76
|
+
static mappings = isSupplement
|
|
77
|
+
? keyValue({ wire: "number", to: "number" }, { wire: "year", to: "year" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "base", to: "base" })
|
|
78
|
+
: JIS_MAPPINGS;
|
|
79
|
+
render() {
|
|
80
|
+
if (isSupplement) {
|
|
81
|
+
const result = `${this.base?.render() ?? ""}/${this.supplementNotation()}`;
|
|
82
|
+
return result + this.symbolSuffix();
|
|
83
|
+
}
|
|
84
|
+
const typePrefix = KIND_PREFIXES[kind];
|
|
85
|
+
let result = typePrefix === undefined ? "JIS" : `JIS ${typePrefix}`;
|
|
86
|
+
result += ` ${this.code()}`;
|
|
87
|
+
result += this.yearAndLanguage();
|
|
88
|
+
if (this.all_parts === true)
|
|
89
|
+
result += "(規格群)";
|
|
90
|
+
return result + this.symbolSuffix();
|
|
91
|
+
}
|
|
92
|
+
supplementNotation() {
|
|
93
|
+
// The #745 year tail: ":YYYY[R]" when the year exists, a bare "R"
|
|
94
|
+
// for a yearless reaffirmation, "" otherwise — never the dangling
|
|
95
|
+
// colon the grammar rejects.
|
|
96
|
+
const yearTail = this.year !== undefined && this.year !== null
|
|
97
|
+
? `:${this.yearWithReaffirmation()}`
|
|
98
|
+
: this.reaffirmed === true
|
|
99
|
+
? "R"
|
|
100
|
+
: "";
|
|
101
|
+
if (kind === "amendment")
|
|
102
|
+
return `AMD ${this.number}${yearTail}`;
|
|
103
|
+
if (kind === "corrigendum")
|
|
104
|
+
return `CORRIGENDUM ${this.number}${yearTail}`;
|
|
105
|
+
if (kind === "explanation") {
|
|
106
|
+
return this.number === undefined ? "EXPL" : `EXPL ${this.number}`;
|
|
107
|
+
}
|
|
108
|
+
return "";
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
registerType(JisKindIdentifier);
|
|
112
|
+
return JisKindIdentifier;
|
|
113
|
+
}
|
|
114
|
+
export const KIND_CLASSES = {
|
|
115
|
+
"japanese-industrial-standard": jisClass("japanese-industrial-standard"),
|
|
116
|
+
"technical-report": jisClass("technical-report"),
|
|
117
|
+
"technical-specification": jisClass("technical-specification"),
|
|
118
|
+
amendment: jisClass("amendment"),
|
|
119
|
+
corrigendum: jisClass("corrigendum"),
|
|
120
|
+
explanation: jisClass("explanation"),
|
|
121
|
+
};
|
|
122
|
+
const WES_TYPE_PREFIXES = {
|
|
123
|
+
"welding-engineering-standard": undefined,
|
|
124
|
+
"welding-engineering-technical-report": "TR",
|
|
125
|
+
"welding-engineering-technical-specification": "TS",
|
|
126
|
+
};
|
|
127
|
+
// WES 7700-1:2019 — JSA sells Welding Engineering Standards next to JIS,
|
|
128
|
+
// so they parse through the JIS flavor, but the id carries no series
|
|
129
|
+
// letter and no JIS prefix ("WES" is the root of the designation). The
|
|
130
|
+
// TR/TS type token after the root picks the WES TR / WES TS classes
|
|
131
|
+
// (pubid#716): "WES TR 2032" is not "WES 2032" and not "TR Z 2032".
|
|
132
|
+
function wesClass(kind) {
|
|
133
|
+
class JisWesIdentifier extends JisIdentifier {
|
|
134
|
+
static polymorphicName = `pubid:jis:${kind}`;
|
|
135
|
+
static attributes = extendAttributes(BaseIdentifier, {
|
|
136
|
+
number: { type: "string" },
|
|
137
|
+
parts: { type: "string", collection: true },
|
|
138
|
+
year: { type: "integer" },
|
|
139
|
+
language: { type: "string" },
|
|
140
|
+
language_before_year: { type: "boolean", equalityIgnored: true },
|
|
141
|
+
all_parts: { type: "boolean", default: false },
|
|
142
|
+
reaffirmed: { type: "boolean" },
|
|
143
|
+
symbol: { type: "string" },
|
|
144
|
+
});
|
|
145
|
+
static mappings = keyValue({ wire: "number", to: "number" }, { wire: "parts", to: "parts" }, { wire: "year", to: "year" }, { wire: "language", to: "language" }, { wire: "language_before_year", to: "language_before_year" }, { wire: "all_parts", to: "all_parts" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "symbol", to: "symbol" });
|
|
146
|
+
code() {
|
|
147
|
+
if (this.base !== undefined)
|
|
148
|
+
return this.base.code();
|
|
149
|
+
const prefix = WES_TYPE_PREFIXES[kind];
|
|
150
|
+
const root = prefix === undefined ? "WES" : `WES ${prefix}`;
|
|
151
|
+
let result = `${root} ${this.number}`;
|
|
152
|
+
if (this.parts !== undefined)
|
|
153
|
+
result += this.parts.map((p) => `-${p}`).join("");
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
render() {
|
|
157
|
+
let result = this.code() ?? "";
|
|
158
|
+
result += this.yearAndLanguage();
|
|
159
|
+
if (this.all_parts === true)
|
|
160
|
+
result += "(規格群)";
|
|
161
|
+
return result + this.symbolSuffix();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
registerType(JisWesIdentifier);
|
|
165
|
+
return JisWesIdentifier;
|
|
166
|
+
}
|
|
167
|
+
export const WES_CLASSES = {
|
|
168
|
+
"welding-engineering-standard": wesClass("welding-engineering-standard"),
|
|
169
|
+
"welding-engineering-technical-report": wesClass("welding-engineering-technical-report"),
|
|
170
|
+
"welding-engineering-technical-specification": wesClass("welding-engineering-technical-specification"),
|
|
171
|
+
};
|
|
172
|
+
class JisUrnGenerator extends BaseUrnGenerator {
|
|
173
|
+
generate() {
|
|
174
|
+
const id = this.identifier;
|
|
175
|
+
const parts = ["urn", "jis"];
|
|
176
|
+
const code = id.code();
|
|
177
|
+
if (code !== undefined)
|
|
178
|
+
parts.push(code);
|
|
179
|
+
if (id.year !== undefined)
|
|
180
|
+
parts.push(String(id.year));
|
|
181
|
+
if (id.language !== undefined)
|
|
182
|
+
parts.push(id.language.toLowerCase());
|
|
183
|
+
if (id.all_parts === true)
|
|
184
|
+
parts.push("all");
|
|
185
|
+
const notation = id.supplementNotation();
|
|
186
|
+
if (id.base !== undefined && notation !== "") {
|
|
187
|
+
parts.push(notation.toLowerCase());
|
|
188
|
+
}
|
|
189
|
+
return parts.join(":");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (const klass of [...Object.values(KIND_CLASSES), ...Object.values(WES_CLASSES)]) {
|
|
193
|
+
klass.urnGenerator = JisUrnGenerator;
|
|
194
|
+
}
|
|
195
|
+
export function isObj(v) {
|
|
196
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
197
|
+
}
|
|
198
|
+
export function extractParts(raw) {
|
|
199
|
+
if (Array.isArray(raw)) {
|
|
200
|
+
return raw.map((p) => (isObj(p) ? String(p["part"]) : String(p)));
|
|
201
|
+
}
|
|
202
|
+
if (isObj(raw) && raw["part"] !== undefined)
|
|
203
|
+
return [String(raw["part"])];
|
|
204
|
+
return [];
|
|
205
|
+
}
|