@pubid/pubid 0.1.31 → 0.1.32
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/artifact/corpus.json.gz +0 -0
- package/dist/flavors/iec/index.js +12 -5
- package/dist/flavors/ieee/index.js +321 -113
- package/dist/flavors/ieee/model.d.ts +18 -0
- package/dist/flavors/ieee/model.js +62 -8
- package/dist/flavors/ieee/preprocessor.js +3 -0
- package/dist/flavors/ieee/update_codes.js +1 -1
- package/dist/flavors/iho/index.js +198 -35
- package/dist/flavors/jis/index.js +74 -2
- package/dist/flavors/nist/grammar.js +44 -16
- package/dist/flavors/nist/index.js +17 -2
- package/dist/urn/parsers.js +57 -20
- package/package.json +2 -2
- package/vendor/parg/adobe.json +1 -1
- package/vendor/parg/aiee.json +1 -1
- package/vendor/parg/amca.json +1 -1
- package/vendor/parg/ansi.json +1 -1
- package/vendor/parg/api.json +1 -1
- package/vendor/parg/ashrae.json +1 -1
- package/vendor/parg/asme.json +1 -1
- package/vendor/parg/astm.json +1 -1
- package/vendor/parg/bipm.json +1 -1
- package/vendor/parg/bsi.json +1 -1
- package/vendor/parg/calconnect.json +1 -1
- package/vendor/parg/ccsds.json +1 -1
- package/vendor/parg/cen_cenelec.json +1 -1
- package/vendor/parg/cie.json +1 -1
- package/vendor/parg/csa.json +1 -1
- package/vendor/parg/doi.json +1 -1
- package/vendor/parg/easc.json +1 -1
- package/vendor/parg/ecma.json +1 -1
- package/vendor/parg/etsi.json +1 -1
- package/vendor/parg/evs.json +1 -1
- package/vendor/parg/gb.json +1 -1
- package/vendor/parg/gost.json +1 -1
- package/vendor/parg/iala.json +1 -1
- package/vendor/parg/iana.json +1 -1
- package/vendor/parg/idf.json +1 -1
- package/vendor/parg/iec.json +1 -1
- package/vendor/parg/ieee.json +1 -29571
- package/vendor/parg/ietf.json +1 -1
- package/vendor/parg/iho.json +1 -0
- package/vendor/parg/ire.json +1 -1
- package/vendor/parg/isbn.json +1 -1
- package/vendor/parg/iso.json +1 -8510
- package/vendor/parg/itu.json +1 -1
- package/vendor/parg/jcgm.json +1 -1
- package/vendor/parg/jis.json +1 -1
- package/vendor/parg/nesc.json +1 -1
- package/vendor/parg/nist.json +1 -9588
- package/vendor/parg/oasis.json +1 -1
- package/vendor/parg/ogc.json +1 -1
- package/vendor/parg/oiml.json +1 -1
- package/vendor/parg/omg.json +1 -1
- package/vendor/parg/parg.json +1 -1
- package/vendor/parg/plateau.json +1 -1
- package/vendor/parg/sae.json +1 -1
- package/vendor/parg/tgpp.json +1 -1
- package/vendor/parg/un.json +1 -1
- package/vendor/parg/w3c.json +1 -1
- package/vendor/parg/xsf.json +1 -1
package/vendor/parg/api.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidApi","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":137}},{"Entity":{"atom":48}},{"Str":{"pattern":"API "}},{"Str":{"pattern":"MPMS"}},{"Named":{"name":"type","atom":3}},{"Entity":{"atom":14}},{"Entity":{"atom":7}},{"Str":{"pattern":" "}},{"Str":{"pattern":"CH"}},{"Entity":{"atom":7}},{"Entity":{"atom":11}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":10,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"chapter","atom":12}},{"Sequence":{"atoms":[6,8,9,13]}},{"Entity":{"atom":16}},{"Str":{"pattern":"."}},{"Entity":{"atom":24}},{"Entity":{"atom":11}},{"Repetition":{"atom":18,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":21}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":20,"min":0,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":22,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[19,23]}},{"Named":{"name":"section","atom":17}},{"Sequence":{"atoms":[15,25]}},{"Repetition":{"atom":26,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Entity":{"atom":24}},{"Named":{"name":"subsection","atom":29}},{"Sequence":{"atoms":[28,30]}},{"Repetition":{"atom":31,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":40}},{"Entity":{"atom":35}},{"Str":{"pattern":"-"}},{"Entity":{"atom":39}},{"Entity":{"atom":11}},{"Repetition":{"atom":37,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":38}},{"Sequence":{"atoms":[34,36]}},{"Entity":{"atom":45}},{"Entity":{"atom":43}},{"Str":{"pattern":":"}},{"Entity":{"atom":39}},{"Sequence":{"atoms":[42,44]}},{"Alternative":{"atoms":[33,41]}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[2,4,5,27,32,47]}},{"Entity":{"atom":95}},{"Str":{"pattern":"API "}},{"Entity":{"atom":61}},{"Str":{"pattern":"MPMS"}},{"Str":{"pattern":"BULL"}},{"Str":{"pattern":"SPEC"}},{"Str":{"pattern":"STD"}},{"Str":{"pattern":"RP"}},{"Str":{"pattern":"TR"}},{"Str":{"pattern":"COS"}},{"Str":{"pattern":"PUBL"}},{"Alternative":{"atoms":[52,53,54,55,56,57,58,59]}},{"Named":{"name":"type","atom":60}},{"Entity":{"atom":7}},{"Entity":{"atom":76}},{"Entity":{"atom":67}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Alternative":{"atoms":[65,66]}},{"Repetition":{"atom":64,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":68}},{"Entity":{"atom":35}},{"Entity":{"atom":67}},{"Repetition":{"atom":71,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":72}},{"Sequence":{"atoms":[70,73]}},{"Repetition":{"atom":74,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[69,75]}},{"Entity":{"atom":82}},{"Str":{"pattern":", Part "}},{"Entity":{"atom":11}},{"Repetition":{"atom":79,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part_number","atom":80}},{"Sequence":{"atoms":[78,81]}},{"Repetition":{"atom":77,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":40}},{"Entity":{"atom":45}},{"Alternative":{"atoms":[84,85]}},{"Repetition":{"atom":86,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":93}},{"Entity":{"atom":7}},{"Str":{"pattern":"(R"}},{"Entity":{"atom":39}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[89,90,91,92]}},{"Repetition":{"atom":88,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[50,51,62,63,83,87,94]}},{"Entity":{"atom":107}},{"Str":{"pattern":"API "}},{"Entity":{"atom":76}},{"Entity":{"atom":82}},{"Repetition":{"atom":99,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":40}},{"Entity":{"atom":45}},{"Alternative":{"atoms":[101,102]}},{"Repetition":{"atom":103,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":93}},{"Repetition":{"atom":105,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[97,98,100,104,106]}},{"Alternative":{"atoms":[1,49,96]}},{"Named":{"name":"first","atom":108}},{"Entity":{"atom":111}},{"Str":{"pattern":"/"}},{"Entity":{"atom":122}},{"Entity":{"atom":61}},{"Entity":{"atom":7}},{"Entity":{"atom":76}},{"Entity":{"atom":82}},{"Repetition":{"atom":116,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":40}},{"Entity":{"atom":45}},{"Alternative":{"atoms":[118,119]}},{"Repetition":{"atom":120,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[113,114,115,117,121]}},{"Named":{"name":"second","atom":112}},{"Entity":{"atom":135}},{"Str":{"pattern":", "}},{"Entity":{"atom":11}},{"Repetition":{"atom":126,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"edition_number","atom":127}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"nd"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"th"}},{"Alternative":{"atoms":[129,130,131,132]}},{"Str":{"pattern":" edition"}},{"Sequence":{"atoms":[125,128,133,134]}},{"Repetition":{"atom":124,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[109,110,123,136]}},{"Entity":{"atom":48}},{"Entity":{"atom":95}},{"Entity":{"atom":107}},{"Alternative":{"atoms":[0,138,139,140]}}],"root":141},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"API RP 1632-1987","expect":{}},{"entry":"identifier","kind":"accept","input":"API MPMS CH 11.1","expect":{}},{"entry":"identifier","kind":"accept","input":"API SPEC 5DP/STD 5DP, 1st edition","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/api/parser.rb: API MPMS/typed/typeless identifiers\n# with slash-combined second identifiers. The API MPMP normalization\n# stays binder-side.\n\ngrammar PubidApi version \"0.1.0\" {\n number_with_part = (1*num_letter_char) as number [(dash (1*num_letter_char) as part)]\n num_letter_char = %x30-39 / %x41-5A\n doc_type = (\"MPMS\" / \"BULL\" / \"SPEC\" / \"STD\" / \"RP\" / \"TR\" / \"COS\" / \"PUBL\") as type\n chapter_notation = space \"CH\" space (1*digit) as chapter\n digits_with_letter = (1*digit [*upper])\n year = (4digit) as year\n date_dash = dash year\n date_colon = colon year\n reaffirmation = space \"(R\" year \")\"\n part_notation = \", Part \" (1*digit) as part_number\n mpms_identifier = \"API \" \"MPMS\" as type chapter_notation [(dot digits_with_letter as section)] [(dot digits_with_letter as subsection)] [(date_dash / date_colon)]\n typed_identifier = \"API \" doc_type space number_with_part [part_notation] [(date_dash / date_colon)] [reaffirmation]\n typeless_identifier = \"API \" number_with_part [part_notation] [(date_dash / date_colon)] [reaffirmation]\n second_identifier = doc_type space number_with_part [part_notation] [(date_dash / date_colon)]\n combined_identifier = ((mpms_identifier / typed_identifier / typeless_identifier) as first) slash (second_identifier as second) [edition_notation]\n edition_notation = \", \" (1*digit) as edition_number (\"st\" / \"nd\" / \"rd\" / \"th\") \" edition\"\n identifier = combined_identifier / mpms_identifier / typed_identifier / typeless_identifier\n upper = %x41-5A\n digit = %x30-39\n dash = \"-\"\n slash = \"/\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n test {\n accept \"API RP 1632-1987\"\n accept \"API MPMS CH 11.1\"\n accept \"API SPEC 5DP/STD 5DP, 1st edition\"\n reject \"nonsense\"\n }\n}\n","source_hash":"3677670f05d8deadf593a3947c52867f69d5254aec9773bd014ab6d007f61499","compiler_version":"1.3.93","checksum":"sha256:2316fb91e748b153913f9428bc6e08b37c03ac7b45d30bc13235134f1455591a"}
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidApi","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":170}},{"Entity":{"atom":46}},{"Str":{"pattern":"API "}},{"Str":{"pattern":"MPMS"}},{"Named":{"name":"type","atom":3}},{"Entity":{"atom":11}},{"Str":{"pattern":" CH "}},{"Entity":{"atom":8}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":7,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"chapter","atom":9}},{"Sequence":{"atoms":[6,10]}},{"Str":{"pattern":"."}},{"Entity":{"atom":8}},{"Repetition":{"atom":13,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":16}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":15,"min":0,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":17,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[14,18]}},{"Named":{"name":"section","atom":19}},{"Sequence":{"atoms":[12,20]}},{"Repetition":{"atom":21,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"."}},{"Entity":{"atom":8}},{"Repetition":{"atom":24,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":16}},{"Repetition":{"atom":26,"min":0,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":27,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[25,28]}},{"Named":{"name":"subsection","atom":29}},{"Sequence":{"atoms":[23,30]}},{"Repetition":{"atom":31,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":39}},{"Str":{"pattern":"-"}},{"Entity":{"atom":38}},{"Entity":{"atom":8}},{"Repetition":{"atom":36,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":37}},{"Sequence":{"atoms":[34,35]}},{"Entity":{"atom":43}},{"Str":{"pattern":":"}},{"Entity":{"atom":38}},{"Sequence":{"atoms":[41,42]}},{"Alternative":{"atoms":[33,40]}},{"Repetition":{"atom":44,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[2,4,5,22,32,45]}},{"Entity":{"atom":93}},{"Str":{"pattern":"API "}},{"Entity":{"atom":59}},{"Str":{"pattern":"MPMS"}},{"Str":{"pattern":"BULL"}},{"Str":{"pattern":"SPEC"}},{"Str":{"pattern":"STD"}},{"Str":{"pattern":"RP"}},{"Str":{"pattern":"TR"}},{"Str":{"pattern":"COS"}},{"Str":{"pattern":"PUBL"}},{"Alternative":{"atoms":[50,51,52,53,54,55,56,57]}},{"Named":{"name":"type","atom":58}},{"Str":{"pattern":" "}},{"Entity":{"atom":75}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Alternative":{"atoms":[62,63]}},{"Repetition":{"atom":64,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":65}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Alternative":{"atoms":[68,69]}},{"Repetition":{"atom":70,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":71}},{"Sequence":{"atoms":[67,72]}},{"Repetition":{"atom":73,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[66,74]}},{"Entity":{"atom":81}},{"Str":{"pattern":", Part "}},{"Entity":{"atom":8}},{"Repetition":{"atom":78,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part_number","atom":79}},{"Sequence":{"atoms":[77,80]}},{"Repetition":{"atom":76,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":39}},{"Entity":{"atom":43}},{"Alternative":{"atoms":[83,84]}},{"Repetition":{"atom":85,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":91}},{"Str":{"pattern":" (R"}},{"Entity":{"atom":38}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[88,89,90]}},{"Repetition":{"atom":87,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[48,49,60,61,82,86,92]}},{"Entity":{"atom":105}},{"Str":{"pattern":"API "}},{"Entity":{"atom":75}},{"Entity":{"atom":81}},{"Repetition":{"atom":97,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":39}},{"Entity":{"atom":43}},{"Alternative":{"atoms":[99,100]}},{"Repetition":{"atom":101,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":91}},{"Repetition":{"atom":103,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[95,96,98,102,104]}},{"Alternative":{"atoms":[1,47,94]}},{"Str":{"pattern":"/"}},{"Entity":{"atom":156}},{"Entity":{"atom":119}},{"Str":{"pattern":"MPMS"}},{"Str":{"pattern":"BULL"}},{"Str":{"pattern":"SPEC"}},{"Str":{"pattern":"STD"}},{"Str":{"pattern":"RP"}},{"Str":{"pattern":"TR"}},{"Str":{"pattern":"COS"}},{"Str":{"pattern":"PUBL"}},{"Alternative":{"atoms":[110,111,112,113,114,115,116,117]}},{"Named":{"name":"second_type","atom":118}},{"Str":{"pattern":" "}},{"Entity":{"atom":135}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Alternative":{"atoms":[122,123]}},{"Repetition":{"atom":124,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"second_number","atom":125}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Alternative":{"atoms":[128,129]}},{"Repetition":{"atom":130,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"second_part","atom":131}},{"Sequence":{"atoms":[127,132]}},{"Repetition":{"atom":133,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[126,134]}},{"Entity":{"atom":141}},{"Str":{"pattern":", Part "}},{"Entity":{"atom":8}},{"Repetition":{"atom":138,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"second_part_number","atom":139}},{"Sequence":{"atoms":[137,140]}},{"Repetition":{"atom":136,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":149}},{"Str":{"pattern":"-"}},{"Entity":{"atom":148}},{"Entity":{"atom":8}},{"Repetition":{"atom":146,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"second_year","atom":147}},{"Sequence":{"atoms":[144,145]}},{"Entity":{"atom":153}},{"Str":{"pattern":":"}},{"Entity":{"atom":148}},{"Sequence":{"atoms":[151,152]}},{"Alternative":{"atoms":[143,150]}},{"Repetition":{"atom":154,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[109,120,121,142,155]}},{"Entity":{"atom":168}},{"Str":{"pattern":", "}},{"Entity":{"atom":8}},{"Repetition":{"atom":159,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"edition_number","atom":160}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"nd"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"th"}},{"Alternative":{"atoms":[162,163,164,165]}},{"Str":{"pattern":" edition"}},{"Sequence":{"atoms":[158,161,166,167]}},{"Repetition":{"atom":157,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[106,107,108,169]}},{"Entity":{"atom":46}},{"Entity":{"atom":93}},{"Entity":{"atom":105}},{"Alternative":{"atoms":[0,171,172,173]}}],"root":174},"bindings":[{"capture":"type","path":"type","type":"string","card":null,"preprocess":null},{"capture":"second_type","path":"second_type","type":"string","card":null,"preprocess":null},{"capture":"chapter","path":"chapter","type":"string","card":null,"preprocess":null},{"capture":"section","path":"section","type":"string","card":null,"preprocess":null},{"capture":"subsection","path":"subsection","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"second_year","path":"second_year","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"part","path":"part","type":"string","card":null,"preprocess":null},{"capture":"second_number","path":"second_number","type":"string","card":null,"preprocess":null},{"capture":"second_part","path":"second_part","type":"string","card":null,"preprocess":null},{"capture":"part_number","path":"part_number","type":"string","card":null,"preprocess":null},{"capture":"second_part_number","path":"second_part_number","type":"string","card":null,"preprocess":null},{"capture":"edition_number","path":"edition_number","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"API RP 1632-1987","expect":{}},{"entry":"identifier","kind":"accept","input":"API MPMS CH 11.1","expect":{}},{"entry":"identifier","kind":"accept","input":"API SPEC 5DP/STD 5DP, 1st edition","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/api/parser.rb: API MPMS/typed/typeless identifiers\n# with slash-combined second identifiers. The API MPMP normalization\n# stays binder-side.\n#\n# Edition-2 notes: the combined form drops its first/second wrapper\n# captures (a wrapper over rule refs expands to element hashes, and the\n# bindings cannot nest); the second identifier's fields capture under\n# second_* names so they never collapse onto the first's, mirroring the\n# csa part_* / iec supp_* position-scoped conventions.\n\ngrammar PubidApi version \"0.1.0\" edition 2 {\n num_letter_char = %x30-39 / %x41-5A\n doc_type = (\"MPMS\" / \"BULL\" / \"SPEC\" / \"STD\" / \"RP\" / \"TR\" / \"COS\" / \"PUBL\") as type\n second_doc_type = (\"MPMS\" / \"BULL\" / \"SPEC\" / \"STD\" / \"RP\" / \"TR\" / \"COS\" / \"PUBL\") as second_type\n chapter_notation = \" CH \" ( 1*digit ) as chapter\n year = ( 4digit ) as year\n second_year = ( 4digit ) as second_year\n date_dash = \"-\" year\n date_colon = \":\" year\n second_date_dash = \"-\" second_year\n second_date_colon = \":\" second_year\n reaffirmation = \" (R\" year \")\"\n part_notation = \", Part \" ( 1*digit ) as part_number\n second_part_notation = \", Part \" ( 1*digit ) as second_part_number\n number_with_part = {\n (\n ( 1*(%x30-39 / %x41-5A) ) as number\n [ \"-\" ( 1*(%x30-39 / %x41-5A) ) as part ]\n )\n }\n second_number_with_part = {\n (\n ( 1*(%x30-39 / %x41-5A) ) as second_number\n [ \"-\" ( 1*(%x30-39 / %x41-5A) ) as second_part ]\n )\n }\n mpms_identifier = {\n \"API \" \"MPMS\" as type chapter_notation\n [ ( \".\" ( 1*digit [*upper] ) as section ) ]\n [ ( \".\" ( 1*digit [*upper] ) as subsection ) ]\n [(date_dash / date_colon)]\n }\n typed_identifier = {\n \"API \" doc_type \" \" number_with_part\n [part_notation]\n [(date_dash / date_colon)]\n [reaffirmation]\n }\n typeless_identifier = {\n \"API \" number_with_part\n [part_notation]\n [(date_dash / date_colon)]\n [reaffirmation]\n }\n second_identifier = {\n second_doc_type \" \" second_number_with_part\n [second_part_notation]\n [(second_date_dash / second_date_colon)]\n }\n edition_notation = \", \" ( 1*digit ) as edition_number (\"st\" / \"nd\" / \"rd\" / \"th\") \" edition\"\n combined_identifier = {\n ( mpms_identifier / typed_identifier / typeless_identifier )\n \"/\"\n second_identifier\n [edition_notation]\n }\n identifier = combined_identifier / mpms_identifier / typed_identifier / typeless_identifier\n upper = %x41-5A\n digit = %x30-39\n dash = \"-\"\n slash = \"/\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n type -> type (string)\n second_type -> second_type (string)\n chapter -> chapter (string)\n section -> section (string)\n subsection -> subsection (string)\n year -> year (string)\n second_year -> second_year (string)\n number -> number (string)\n part -> part (string)\n second_number -> second_number (string)\n second_part -> second_part (string)\n part_number -> part_number (string)\n second_part_number -> second_part_number (string)\n edition_number -> edition_number (string)\n }\n\n test {\n accept \"API RP 1632-1987\"\n accept \"API MPMS CH 11.1\"\n accept \"API SPEC 5DP/STD 5DP, 1st edition\"\n reject \"nonsense\"\n }\n}\n","source_hash":"c4bda4490af8a22aeb81fa6f4dd00ec17d36f2b42d0bc418252c43406dcd28d8","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.121","edition":2,"semantics_hash":"sha256:e3c89569389cdbfd0c02c924bfa0c02b76c36ea6165f0470b292890f08a1af77","checksum":"sha256:d5c883f062bd017b8e1143c6278ce67f8501afff65effa2cc0149b7d7d4b60a8"}
|