pubid 2.0.49 → 2.0.51

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42fbb6b3f8ca5fb3840ded3e83f28ff5d4c9b9120ab3f3f904de59cbc95deb79
4
- data.tar.gz: a18dfffb5aa61f9d5884b6e227488b36570c07629d1b32bc5c0c494643ce7279
3
+ metadata.gz: 8aaeac43169385a86880c0162e397c091c711b11489a782a6283a3b7d2e061bd
4
+ data.tar.gz: b9159203625663b81e15d91c0fd33e447be13c5d1c0277f2e8471a6b6325e5c3
5
5
  SHA512:
6
- metadata.gz: d3bd5d576722dcf75c5cacb79d915b032b19a3521c71149ef471ff5c469fe93430ad185d78878f4cdc9752288d36aa5984fdc3eb4b42e6f200162530e2de380d
7
- data.tar.gz: e1691661c2b2d9c60c7bb1c2712ab5b1f0e4bcfe3d521c1dd9da7d23c4cd31c0b6750b3fd6e4557b3a16435237d07e9289011a306f9b367e908ba4110655a926
6
+ metadata.gz: bb0e5dfaeebb9994f37e13b9cc9fa25819b72233f7d647c78a1aaf2d9098faf5122a5c3f46836ac85f3678fcb5f601fab7710e5f46eb93bade79ef15c586e628
7
+ data.tar.gz: 17b498c6a7f7e72ad16398b0bd7c8783b9b017348b1770ebc00763f852d63bafe9733625c83ea21aada5e1ece554874800faa800d355ecd7a0a1b64afb5ea7ed
data/data/parg/adobe.json CHANGED
@@ -1 +1 @@
1
- {"bindings":null,"version":"0.1.0","grammar":"PubidAdobe","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":40}},{"Str":{"pattern":"Adobe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"TN"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":4,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,2,3,5]}},{"Str":{"pattern":"Adobe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Technical"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Note"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":12,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"#"}},{"Repetition":{"atom":14,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":16,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[13,15,17]}},{"Repetition":{"atom":18,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[7,8,9,10,11,19]}},{"Str":{"pattern":"ATN"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":22,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[21,23]}},{"Alternative":{"atoms":[6,20,24]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":26,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":27}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[_]"}},{"Alternative":{"atoms":[30,31,32,33]}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"slug","atom":35}},{"Sequence":{"atoms":[29,36]}},{"Repetition":{"atom":37,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[25,28,38]}},{"Named":{"name":"tech_note","atom":39}},{"Entity":{"atom":44}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":42,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"tech_note_bare","atom":43}},{"Entity":{"atom":92}},{"Str":{"pattern":"Adobe Publication "}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":91}},{"Entity":{"atom":72}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":50,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[52,53]}},{"Repetition":{"atom":54,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":57,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[59,60]}},{"Repetition":{"atom":61,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[56,58,62]}},{"Repetition":{"atom":63,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[51,55,64]}},{"Named":{"name":"slug","atom":65}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":68,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"version","atom":69}},{"Sequence":{"atoms":[66,67,70]}},{"Named":{"name":"publication_version","atom":71}},{"Entity":{"atom":90}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":74,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[76,77]}},{"Repetition":{"atom":78,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":81,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[83,84]}},{"Repetition":{"atom":85,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[80,82,86]}},{"Repetition":{"atom":87,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[75,79,88]}},{"Named":{"name":"slug","atom":89}},{"Alternative":{"atoms":[49,73]}},{"Sequence":{"atoms":[47,48]}},{"Alternative":{"atoms":[0,41,45]}}],"root":93},"bindings":[{"capture":"tech_note","path":"tech_note","type":"raw","card":null,"preprocess":null},{"capture":"tech_note_bare","path":"tech_note_bare","type":"string","card":null,"preprocess":null},{"capture":"publication_version","path":"publication_version","type":"raw","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"slug","path":"slug","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule publication_slug_or_version: 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)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"Adobe TN 15","expect":{}},{"entry":"identifier","kind":"accept","input":"ATN 30","expect":{}},{"entry":"identifier","kind":"accept","input":"Adobe Technical Note #12","expect":{}},{"entry":"identifier","kind":"reject","input":"###","expect":{}}],"docs":{},"source":"# Port of lib/pubid/adobe/parser.rb: tech notes (Adobe TN 5014, legacy\n# \"Adobe Technical Note #5014\", ATN5014, bare 5014) and publications\n# (adobe-glyph-list, adobe-japan1-7 with the version split tried first).\n#\n# Edition 2: every reference inside a captured body is inlined to raw\n# terms (a rule reference materializes as a named node in the edition-2\n# tree, so only a raw capture binds a scalar span). The prefix spellings\n# and slug shapes live inline below; the wrapper captures (tech_note,\n# tech_note_bare, publication_version) keep the v1 tree shape and the\n# bindings name their scalar leaves.\n\ngrammar PubidAdobe version \"0.1.0\" edition 2 {\n\n # Capture precedence: (*rep) as name wraps the whole repetition, so a\n # digit run joins to one string instead of re-keying every character;\n # slug is captured exactly once (the bare form) or as a sibling of\n # version inside the publication_version capture. The three prefix\n # spellings are inlined longest-first (ordered choice is decisive).\n tech_note = {\n (\n ( \"Adobe\" \" \" \"TN\" [\" \"]\n / \"Adobe\" \" \" \"Technical\" \" \" \"Note\" [[\" \"] [\"#\"] [\" \"]]\n / \"ATN\" [\" \"] )\n (1*%x30-39) as number\n [(\".\" (1*(%x41-5A / %x61-7A / %x30-39 / %x5F)) as slug)]\n ) as tech_note\n }\n # The bare form captures the digit run as one span: the builder\n # stringifies the :tech_note_bare value AS the number (no nested read),\n # so an inner capture here would render the hash, not the digits.\n bare_number = (1*%x30-39) as tech_note_bare\n # Slug text: a lower-case lead segment, then dash-joined segments.\n publication_with_version = {\n (\n ( 1*%x61-7A *(%x61-7A / %x30-39)\n *(\"-\" 1*%x61-7A *(%x61-7A / %x30-39)) ) as slug\n \"-\"\n (1*%x30-39) as version\n ) as publication_version\n }\n slug_inner = {\n ( 1*%x61-7A *(%x61-7A / %x30-39)\n *(\"-\" 1*%x61-7A *(%x61-7A / %x30-39)) ) as slug\n }\n publication_slug_or_version = publication_with_version / slug_inner\n publication = [\"Adobe Publication \"] publication_slug_or_version\n identifier = tech_note / bare_number / publication\n\n entry identifier: identifier\n\n test {\n accept \"Adobe TN 15\"\n accept \"ATN 30\"\n accept \"Adobe Technical Note #12\"\n reject \"###\"\n }\n\n bindings identifier {\n # The builder dispatches on the wrapper keys and reads the leaves from\n # inside them (adobe/builder.rb build_tech_note / build_publication_version),\n # so the wrappers bind uncast — the nested hash the builder expects. The\n # scalar bindings carry the same leaves flat for typed consumers.\n tech_note -> tech_note (raw)\n tech_note_bare -> tech_note_bare (string)\n publication_version -> publication_version (raw)\n number -> number (string)\n slug -> slug (string)\n version -> version (string)\n }\n}\n","source_hash":"ebe64b2104b3e1494b9c5ba304e3b7e62f95b3430851db7f5c09549e03fcefb9","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:a56693eaf290b40d9d94ed91611d4aa108e9827d578071062b17ca072658cc25","checksum":"sha256:eaa21af1ff3767e4094ecf376637020c4db9f106a48ceaf083e49d7e281be173","validated":{"lint_errors":0,"lint_warnings":2,"tests_total":4,"tests_failures":0,"self_test":true}}
1
+ {"bindings":null,"version":"0.2.0","grammar":"PubidAdobe","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":40}},{"Str":{"pattern":"Adobe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"TN"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":4,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,2,3,5]}},{"Str":{"pattern":"Adobe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Technical"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Note"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":12,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"#"}},{"Repetition":{"atom":14,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":16,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[13,15,17]}},{"Repetition":{"atom":18,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[7,8,9,10,11,19]}},{"Str":{"pattern":"ATN"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":22,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[21,23]}},{"Alternative":{"atoms":[6,20,24]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":26,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":27}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[_]"}},{"Alternative":{"atoms":[30,31,32,33]}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"slug","atom":35}},{"Sequence":{"atoms":[29,36]}},{"Repetition":{"atom":37,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[25,28,38]}},{"Named":{"name":"tech_note","atom":39}},{"Entity":{"atom":44}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":42,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"tech_note_bare","atom":43}},{"Entity":{"atom":98}},{"Str":{"pattern":"Adobe Publication "}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":97}},{"Entity":{"atom":78}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":50,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[52,53]}},{"Repetition":{"atom":54,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":57,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[59,60]}},{"Repetition":{"atom":61,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[56,58,62]}},{"Repetition":{"atom":63,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[51,55,64]}},{"Named":{"name":"slug","atom":65}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":68,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":71,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[70,72]}},{"Repetition":{"atom":73,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[69,74]}},{"Named":{"name":"version","atom":75}},{"Sequence":{"atoms":[66,67,76]}},{"Named":{"name":"publication_version","atom":77}},{"Entity":{"atom":96}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":80,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[82,83]}},{"Repetition":{"atom":84,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":87,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[89,90]}},{"Repetition":{"atom":91,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[86,88,92]}},{"Repetition":{"atom":93,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[81,85,94]}},{"Named":{"name":"slug","atom":95}},{"Alternative":{"atoms":[49,79]}},{"Sequence":{"atoms":[47,48]}},{"Alternative":{"atoms":[0,41,45]}}],"root":99},"bindings":[{"capture":"tech_note","path":"tech_note","type":"raw","card":null,"preprocess":null},{"capture":"tech_note_bare","path":"tech_note_bare","type":"string","card":null,"preprocess":null},{"capture":"publication_version","path":"publication_version","type":"raw","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"slug","path":"slug","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule publication_slug_or_version: 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)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"Adobe TN 15","expect":{}},{"entry":"identifier","kind":"accept","input":"ATN 30","expect":{}},{"entry":"identifier","kind":"accept","input":"Adobe Technical Note #12","expect":{}},{"entry":"identifier","kind":"accept","input":"pdf-reference-1.7","expect":{}},{"entry":"identifier","kind":"accept","input":"Adobe Publication tiff-6.0","expect":{}},{"entry":"identifier","kind":"accept","input":"Adobe Publication xfa-3.3","expect":{}},{"entry":"identifier","kind":"accept","input":"adobe-japan1-7","expect":{}},{"entry":"identifier","kind":"reject","input":"###","expect":{}}],"docs":{},"source":"# Port of lib/pubid/adobe/parser.rb: tech notes (Adobe TN 5014, legacy\n# \"Adobe Technical Note #5014\", ATN5014, bare 5014) and publications\n# (adobe-glyph-list, adobe-japan1-7 with the version split tried first).\n#\n# Edition 2: every reference inside a captured body is inlined to raw\n# terms (a rule reference materializes as a named node in the edition-2\n# tree, so only a raw capture binds a scalar span). The prefix spellings\n# and slug shapes live inline below; the wrapper captures (tech_note,\n# tech_note_bare, publication_version) keep the v1 tree shape and the\n# bindings name their scalar leaves.\n\ngrammar PubidAdobe version \"0.2.0\" edition 2 {\n\n # Capture precedence: (*rep) as name wraps the whole repetition, so a\n # digit run joins to one string instead of re-keying every character;\n # slug is captured exactly once (the bare form) or as a sibling of\n # version inside the publication_version capture. The three prefix\n # spellings are inlined longest-first (ordered choice is decisive).\n tech_note = {\n (\n ( \"Adobe\" \" \" \"TN\" [\" \"]\n / \"Adobe\" \" \" \"Technical\" \" \" \"Note\" [[\" \"] [\"#\"] [\" \"]]\n / \"ATN\" [\" \"] )\n (1*%x30-39) as number\n [(\".\" (1*(%x41-5A / %x61-7A / %x30-39 / %x5F)) as slug)]\n ) as tech_note\n }\n # The bare form captures the digit run as one span: the builder\n # stringifies the :tech_note_bare value AS the number (no nested read),\n # so an inner capture here would render the hash, not the digits.\n bare_number = (1*%x30-39) as tech_note_bare\n # Slug text: a lower-case lead segment, then dash-joined segments.\n # The version face is a dot-joined digit run (\"7\", \"1.7\", \"6.0\") — the\n # PDF Reference editions, TIFF 6.0 and XFA 3.3 carry dotted versions.\n publication_with_version = {\n (\n ( 1*%x61-7A *(%x61-7A / %x30-39)\n *(\"-\" 1*%x61-7A *(%x61-7A / %x30-39)) ) as slug\n \"-\"\n ( 1*%x30-39 *( \".\" 1*%x30-39 ) ) as version\n ) as publication_version\n }\n slug_inner = {\n ( 1*%x61-7A *(%x61-7A / %x30-39)\n *(\"-\" 1*%x61-7A *(%x61-7A / %x30-39)) ) as slug\n }\n publication_slug_or_version = publication_with_version / slug_inner\n publication = [\"Adobe Publication \"] publication_slug_or_version\n identifier = tech_note / bare_number / publication\n\n entry identifier: identifier\n\n test {\n accept \"Adobe TN 15\"\n accept \"ATN 30\"\n accept \"Adobe Technical Note #12\"\n accept \"pdf-reference-1.7\"\n accept \"Adobe Publication tiff-6.0\"\n accept \"Adobe Publication xfa-3.3\"\n accept \"adobe-japan1-7\"\n reject \"###\"\n }\n\n bindings identifier {\n # The builder dispatches on the wrapper keys and reads the leaves from\n # inside them (adobe/builder.rb build_tech_note / build_publication_version),\n # so the wrappers bind uncast — the nested hash the builder expects. The\n # scalar bindings carry the same leaves flat for typed consumers.\n tech_note -> tech_note (raw)\n tech_note_bare -> tech_note_bare (string)\n publication_version -> publication_version (raw)\n number -> number (string)\n slug -> slug (string)\n version -> version (string)\n }\n}\n","source_hash":"716ecf16e7525972b7a01fa986f4e6a81898080dbdf0a84e516447e729d8e7b4","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:77a3e453cf351ab679c4295ff10126a094b6c8d390f54f67703dc8cc7799c12b","checksum":"sha256:680933a1482ee9cf4875d20f36496986cf7b2f20f2c4ca5cf6ceff6f5a093328","validated":{"lint_errors":0,"lint_warnings":2,"tests_total":8,"tests_failures":0,"self_test":true}}
data/data/parg/iala.json CHANGED
@@ -1 +1 @@
1
- {"bindings":null,"version":"0.1.0","grammar":"PubidIala","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":102}},{"Entity":{"atom":3}},{"Str":{"pattern":"IALA "}},{"Repetition":{"atom":2,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Str":{"pattern":"GA"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"X"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[5,6,7,8,9,10,11,12,13,14]}},{"Named":{"name":"type_letter","atom":15}},{"Entity":{"atom":32}},{"Entity":{"atom":22}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":19,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number","atom":21}},{"Entity":{"atom":29}},{"Entity":{"atom":25}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Repetition":{"atom":26,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"dotted_segment","atom":27}},{"Sequence":{"atoms":[24,28]}},{"Repetition":{"atom":23,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number_dots","atom":30}},{"Sequence":{"atoms":[18,31]}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Entity":{"atom":36}},{"Str":{"pattern":"-"}},{"Entity":{"atom":20}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart_number","atom":38}},{"Sequence":{"atoms":[35,39]}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart","atom":41}},{"Repetition":{"atom":33,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,17,43]}},{"Named":{"name":"base","atom":44}},{"Entity":{"atom":47}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[48,49]}},{"Named":{"name":"annex_marker","atom":50}},{"Entity":{"atom":47}},{"Entity":{"atom":54}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Named":{"name":"annex_letter","atom":53}},{"Entity":{"atom":57}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Lookahead":{"atom":56,"positive":false}},{"Sequence":{"atoms":[52,55,58]}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":76}},{"Entity":{"atom":47}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":47}},{"Entity":{"atom":74}},{"Entity":{"atom":20}},{"Repetition":{"atom":66,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":25}},{"Entity":{"atom":20}},{"Repetition":{"atom":69,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[68,70]}},{"Repetition":{"atom":71,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[67,72]}},{"Named":{"name":"edition_value","atom":73}},{"Sequence":{"atoms":[62,63,64,65]}},{"Named":{"name":"edition","atom":75}},{"Entity":{"atom":83}},{"Entity":{"atom":79}},{"Str":{"pattern":":"}},{"Str":{"pattern":"ed"}},{"Entity":{"atom":74}},{"Sequence":{"atoms":[78,80,81]}},{"Named":{"name":"edition","atom":82}},{"Alternative":{"atoms":[61,77]}},{"Repetition":{"atom":84,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Entity":{"atom":47}},{"Repetition":{"atom":87,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"R"}},{"Alternative":{"atoms":[90,91,92,93,94,95]}},{"Named":{"name":"language","atom":96}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[88,89,97,98]}},{"Named":{"name":"language_group","atom":99}},{"Repetition":{"atom":86,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[45,46,51,60,85,101]}},{"Entity":{"atom":117}},{"Entity":{"atom":3}},{"Entity":{"atom":110}},{"Entity":{"atom":16}},{"Entity":{"atom":32}},{"Entity":{"atom":42}},{"Repetition":{"atom":108,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[106,107,109]}},{"Entity":{"atom":76}},{"Entity":{"atom":83}},{"Alternative":{"atoms":[111,112]}},{"Repetition":{"atom":113,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Repetition":{"atom":115,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[104,105,114,116]}},{"Alternative":{"atoms":[0,103]}}],"root":118},"bindings":[{"capture":"type_letter","path":"type_letter","type":"string","card":null,"preprocess":null},{"capture":"doc_number","path":"doc_number","type":"string","card":null,"preprocess":null},{"capture":"dotted_segment","path":"doc_number_dots[].dotted_segment","type":"string","card":null,"preprocess":null},{"capture":"subpart_number","path":"subpart[].subpart_number","type":"string","card":null,"preprocess":null},{"capture":"edition_value","path":"edition_value","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"annex_marker","path":"annex_marker","type":"string","card":null,"preprocess":null},{"capture":"annex_letter","path":"annex_letter","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)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"G1040","expect":{}},{"entry":"identifier","kind":"accept","input":"GA1040","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"accept","input":"R1016:ed2.0(F)","expect":{}},{"entry":"identifier","kind":"accept","input":"C0103-1 Ed 3.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA L2.1.11 Ed 2","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1128 Annex A Ed 1.6","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1045 Annex Ed 1","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA A12-01 (E)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"example","input":"G1040","expect":{"type_letter":"G","doc_number":"1040"}},{"entry":"identifier","kind":"example","input":"GA01.01","expect":{"type_letter":"GA","doc_number":"01","doc_number_dots":[{"dotted_segment":"01"}]}},{"entry":"identifier","kind":"example","input":"C0103-1","expect":{"type_letter":"C","doc_number":"0103","subpart":[{"subpart_number":"1"}]}},{"entry":"identifier","kind":"example","input":"IALA S1070 Ed 2.0","expect":{"type_letter":"S","doc_number":"1070","edition_value":"2.0"}},{"entry":"identifier","kind":"example","input":"IALA G1128 Annex A Ed 1.6","expect":{"type_letter":"G","doc_number":"1128","annex_marker":"Annex","annex_letter":"A","edition_value":"1.6"}}],"docs":{},"source":"# Port of lib/pubid/iala/parser.rb: [IALA ]<type><number>[.dots][-subs]\n# [ Ed X.Y | :edX.Y] [(L)], plus the Annex-to-base form. The annex\n# letter guard (!lower) keeps \"Ed 1\" from mis-capturing.\n#\n# Edition-2 conversion with typed model bindings. Deviations from the\n# v1 tree:\n# - the dotted continuation and the dash subpart repeat capture-bearing\n# rule refs (the itu `parts` shape): a repetition over a capture-less\n# unit harvested as a bare span binds differently per engine, so the\n# bindings read the inner captures through the array paths\n# `doc_number_dots[].dotted_segment` and `subpart[].subpart_number`.\n# The dotted segment gains its own capture (`dotted_segment`); the\n# subpart keeps its `subpart_number` capture, hoisted out of the\n# inline repetition into a rule ref of its own.\n# - the annex base composite stays unbound. Every capture inside it\n# (type_letter, doc_number, …) is the only occurrence of its name on\n# the annex path, so the binding harvest hoists it to the top level:\n# the builder reads one flat map for the plain and the annex form\n# alike and dispatches on :annex_marker. edition_value and language\n# hoist out of their edition/language_group composites the same way.\n\ngrammar PubidIala version \"0.1.0\" edition 2 {\n type_letter = (\"GA\" / \"S\" / \"R\" / \"G\" / \"M\" / \"C\" / \"A\" / \"L\" / \"X\" / \"P\") as type_letter\n doc_number = (1*digit) as doc_number\n dotted_number = dot (1*digit) as dotted_segment\n number_with_dots = doc_number (*dotted_number) as doc_number_dots\n subpart_number = dash (1*digit) as subpart_number\n subpart = (1*subpart_number) as subpart\n code = type_letter number_with_dots [subpart]\n edition_value = (1*digit *(dot 1*digit)) as edition_value\n edition_human = (space \"Ed\" space edition_value) as edition\n edition_compact = (colon \"ed\" edition_value) as edition\n language_group = ([space] \"(\" (\"E\" / \"F\" / \"S\" / \"C\" / \"A\" / \"R\") as language \")\") as language_group\n annex_identifier = {\n ((publisher type_letter number_with_dots [subpart]) as base)\n space\n (\"Annex\" / \"ANNEX\") as annex_marker\n [ (space upper as annex_letter !lower) ]\n [edition_human / edition_compact]\n [language_group]\n }\n plain_identifier = {\n publisher code [edition_human / edition_compact] [language_group]\n }\n identifier = {\n annex_identifier\n / plain_identifier\n }\n publisher = [\"IALA \"]\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dash = \"-\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n type_letter -> type_letter (string)\n doc_number -> doc_number (string)\n dotted_segment -> doc_number_dots[].dotted_segment (string)\n subpart_number -> subpart[].subpart_number (string)\n edition_value -> edition_value (string)\n language -> language (string)\n annex_marker -> annex_marker (string)\n annex_letter -> annex_letter (string)\n }\n\n test {\n accept \"G1040\"\n accept \"GA1040\"\n accept \"IALA S1070 Ed 2.0\"\n accept \"R1016:ed2.0(F)\"\n accept \"C0103-1 Ed 3.0\"\n accept \"IALA L2.1.11 Ed 2\"\n accept \"IALA G1128 Annex A Ed 1.6\"\n accept \"IALA G1045 Annex Ed 1\"\n accept \"IALA A12-01 (E)\"\n reject \"nonsense\"\n example \"G1040\" { type_letter: \"G\", doc_number: \"1040\" }\n example \"GA01.01\" {\n type_letter: \"GA\",\n doc_number: \"01\",\n doc_number_dots: [ { dotted_segment: \"01\" } ],\n }\n example \"C0103-1\" {\n type_letter: \"C\",\n doc_number: \"0103\",\n subpart: [ { subpart_number: \"1\" } ],\n }\n example \"IALA S1070 Ed 2.0\" {\n type_letter: \"S\",\n doc_number: \"1070\",\n edition_value: \"2.0\",\n }\n example \"IALA G1128 Annex A Ed 1.6\" {\n type_letter: \"G\",\n doc_number: \"1128\",\n annex_marker: \"Annex\",\n annex_letter: \"A\",\n edition_value: \"1.6\",\n }\n }\n}\n","source_hash":"876c56b59effe0fff6067618955aa411a9d5287848c677b093aacc830562d000","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:bfeb1b06d5a84459e59ff6642e7013c2e95b6ccdc9eb6b6da4d6f0bda7ca85a2","checksum":"sha256:90ef4e159318190b7269b51bbacb6e94145fb0b5f2e336c6821318d539bac76a","validated":{"lint_errors":0,"lint_warnings":1,"tests_total":15,"tests_failures":0,"self_test":true}}
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidIala","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":102}},{"Entity":{"atom":3}},{"Str":{"pattern":"IALA "}},{"Repetition":{"atom":2,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Str":{"pattern":"GA"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"X"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[5,6,7,8,9,10,11,12,13,14]}},{"Named":{"name":"type_letter","atom":15}},{"Entity":{"atom":32}},{"Entity":{"atom":22}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":19,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number","atom":21}},{"Entity":{"atom":29}},{"Entity":{"atom":25}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Repetition":{"atom":26,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"dotted_segment","atom":27}},{"Sequence":{"atoms":[24,28]}},{"Repetition":{"atom":23,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number_dots","atom":30}},{"Sequence":{"atoms":[18,31]}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Entity":{"atom":36}},{"Str":{"pattern":"-"}},{"Entity":{"atom":20}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart_number","atom":38}},{"Sequence":{"atoms":[35,39]}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart","atom":41}},{"Repetition":{"atom":33,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,17,43]}},{"Named":{"name":"base","atom":44}},{"Entity":{"atom":47}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[48,49]}},{"Named":{"name":"annex_marker","atom":50}},{"Entity":{"atom":47}},{"Entity":{"atom":54}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Named":{"name":"annex_letter","atom":53}},{"Entity":{"atom":57}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Lookahead":{"atom":56,"positive":false}},{"Sequence":{"atoms":[52,55,58]}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":76}},{"Entity":{"atom":47}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":47}},{"Entity":{"atom":74}},{"Entity":{"atom":20}},{"Repetition":{"atom":66,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":25}},{"Entity":{"atom":20}},{"Repetition":{"atom":69,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[68,70]}},{"Repetition":{"atom":71,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[67,72]}},{"Named":{"name":"edition_value","atom":73}},{"Sequence":{"atoms":[62,63,64,65]}},{"Named":{"name":"edition","atom":75}},{"Entity":{"atom":83}},{"Entity":{"atom":79}},{"Str":{"pattern":":"}},{"Str":{"pattern":"ed"}},{"Entity":{"atom":74}},{"Sequence":{"atoms":[78,80,81]}},{"Named":{"name":"edition","atom":82}},{"Alternative":{"atoms":[61,77]}},{"Repetition":{"atom":84,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Entity":{"atom":47}},{"Repetition":{"atom":87,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"R"}},{"Alternative":{"atoms":[90,91,92,93,94,95]}},{"Named":{"name":"language","atom":96}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[88,89,97,98]}},{"Named":{"name":"language_group","atom":99}},{"Repetition":{"atom":86,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[45,46,51,60,85,101]}},{"Entity":{"atom":117}},{"Entity":{"atom":3}},{"Entity":{"atom":110}},{"Entity":{"atom":16}},{"Entity":{"atom":32}},{"Entity":{"atom":42}},{"Repetition":{"atom":108,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[106,107,109]}},{"Entity":{"atom":76}},{"Entity":{"atom":83}},{"Alternative":{"atoms":[111,112]}},{"Repetition":{"atom":113,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Repetition":{"atom":115,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[104,105,114,116]}},{"Entity":{"atom":147}},{"Str":{"pattern":"IALA "}},{"Entity":{"atom":142}},{"Entity":{"atom":130}},{"Entity":{"atom":57}},{"Repetition":{"atom":122,"min":0,"max":2,"tag":"Repetition"}},{"Entity":{"atom":20}},{"Repetition":{"atom":124,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":57}},{"Entity":{"atom":20}},{"Alternative":{"atoms":[126,127]}},{"Lookahead":{"atom":128,"positive":false}},{"Sequence":{"atoms":[123,125,129]}},{"Lookahead":{"atom":121,"positive":false}},{"Entity":{"atom":136}},{"Entity":{"atom":57}},{"Entity":{"atom":20}},{"Alternative":{"atoms":[133,134]}},{"Repetition":{"atom":135,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":36}},{"Entity":{"atom":136}},{"Sequence":{"atoms":[137,138]}},{"Repetition":{"atom":139,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[131,132,140]}},{"Named":{"name":"slug","atom":141}},{"Entity":{"atom":76}},{"Repetition":{"atom":143,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Repetition":{"atom":145,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[119,120,144,146]}},{"Alternative":{"atoms":[0,103,118]}}],"root":148},"bindings":[{"capture":"type_letter","path":"type_letter","type":"string","card":null,"preprocess":null},{"capture":"doc_number","path":"doc_number","type":"string","card":null,"preprocess":null},{"capture":"dotted_segment","path":"doc_number_dots[].dotted_segment","type":"string","card":null,"preprocess":null},{"capture":"subpart_number","path":"subpart[].subpart_number","type":"string","card":null,"preprocess":null},{"capture":"edition_value","path":"edition_value","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"annex_marker","path":"annex_marker","type":"string","card":null,"preprocess":null},{"capture":"annex_letter","path":"annex_letter","type":"string","card":null,"preprocess":null},{"capture":"slug","path":"slug","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 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"G1040","expect":{}},{"entry":"identifier","kind":"accept","input":"GA1040","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"accept","input":"R1016:ed2.0(F)","expect":{}},{"entry":"identifier","kind":"accept","input":"C0103-1 Ed 3.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA L2.1.11 Ed 2","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1128 Annex A Ed 1.6","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1045 Annex Ed 1","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA A12-01 (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA 13th-vts-symposium-report (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA iala-style-guide Ed 1.0 (E)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA Arctic-Seminar-Report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA -arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic seminar report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic-","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic--report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA s1070","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA c0103-1","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA 1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"example","input":"G1040","expect":{"type_letter":"G","doc_number":"1040"}},{"entry":"identifier","kind":"example","input":"GA01.01","expect":{"type_letter":"GA","doc_number":"01","doc_number_dots":[{"dotted_segment":"01"}]}},{"entry":"identifier","kind":"example","input":"C0103-1","expect":{"type_letter":"C","doc_number":"0103","subpart":[{"subpart_number":"1"}]}},{"entry":"identifier","kind":"example","input":"IALA S1070 Ed 2.0","expect":{"type_letter":"S","doc_number":"1070","edition_value":"2.0"}},{"entry":"identifier","kind":"example","input":"IALA G1128 Annex A Ed 1.6","expect":{"type_letter":"G","doc_number":"1128","annex_marker":"Annex","annex_letter":"A","edition_value":"1.6"}},{"entry":"identifier","kind":"example","input":"IALA arctic-seminar-report (E)","expect":{"slug":"arctic-seminar-report","language":"E"}},{"entry":"identifier","kind":"example","input":"IALA iala-world-wide-radio-navigation-plan Ed 2","expect":{"slug":"iala-world-wide-radio-navigation-plan","edition_value":"2"}}],"docs":{},"source":"# Port of lib/pubid/iala/parser.rb: [IALA ]<type><number>[.dots][-subs]\n# [ Ed X.Y | :edX.Y] [(L)], plus the Annex-to-base form. The annex\n# letter guard (!lower) keeps \"Ed 1\" from mis-capturing.\n#\n# Edition-2 conversion with typed model bindings. Deviations from the\n# v1 tree:\n# - the dotted continuation and the dash subpart repeat capture-bearing\n# rule refs (the itu `parts` shape): a repetition over a capture-less\n# unit harvested as a bare span binds differently per engine, so the\n# bindings read the inner captures through the array paths\n# `doc_number_dots[].dotted_segment` and `subpart[].subpart_number`.\n# The dotted segment gains its own capture (`dotted_segment`); the\n# subpart keeps its `subpart_number` capture, hoisted out of the\n# inline repetition into a rule ref of its own.\n# - the annex base composite stays unbound. Every capture inside it\n# (type_letter, doc_number, …) is the only occurrence of its name on\n# the annex path, so the binding harvest hoists it to the top level:\n# the builder reads one flat map for the plain and the annex form\n# alike and dispatches on :annex_marker. edition_value and language\n# hoist out of their edition/language_group composites the same way.\n#\n# The codeless (slug) form: iala.int lists some publications (reports\n# and proceedings, the style guide, history books, radio plans) with no\n# code, and relaton gives them the product-URL slug as docid, e.g.\n# \"IALA arctic-seminar-report (E)\". slug_identifier is the last\n# alternative, so every typed code keeps priority; a typed code starts\n# upper-case and a slug lower-case or with a digit, so the two never\n# overlap. The \"IALA \" prefix is mandatory here (it is optional for a\n# typed code): without it any lower-case word would parse. The slug has\n# no space, so it never takes the trailing \" Ed <edition>\" or \" (<L>)\".\n# A slug is two or more hyphen-joined [a-z0-9] runs (every corpus slug\n# is), and its first run must not look like a code (0-2 letters and\n# digits: \"s1070\", \"ga01\", \"1070\"), so a lower-case or letterless typo\n# of a typed code (\"IALA s1070\", \"IALA c0103-1\", \"IALA 1070 Ed 2.0\")\n# still fails instead of parsing as a codeless publication.\n\ngrammar PubidIala version \"0.1.0\" edition 2 {\n type_letter = (\"GA\" / \"S\" / \"R\" / \"G\" / \"M\" / \"C\" / \"A\" / \"L\" / \"X\" / \"P\") as type_letter\n doc_number = (1*digit) as doc_number\n dotted_number = dot (1*digit) as dotted_segment\n number_with_dots = doc_number (*dotted_number) as doc_number_dots\n subpart_number = dash (1*digit) as subpart_number\n subpart = (1*subpart_number) as subpart\n code = type_letter number_with_dots [subpart]\n edition_value = (1*digit *(dot 1*digit)) as edition_value\n edition_human = (space \"Ed\" space edition_value) as edition\n edition_compact = (colon \"ed\" edition_value) as edition\n language_group = ([space] \"(\" (\"E\" / \"F\" / \"S\" / \"C\" / \"A\" / \"R\") as language \")\") as language_group\n annex_identifier = {\n ((publisher type_letter number_with_dots [subpart]) as base)\n space\n (\"Annex\" / \"ANNEX\") as annex_marker\n [ (space upper as annex_letter !lower) ]\n [edition_human / edition_compact]\n [language_group]\n }\n plain_identifier = {\n publisher code [edition_human / edition_compact] [language_group]\n }\n slug_segment = 1*(lower / digit)\n slug_code_like = *2lower 1*digit !(lower / digit)\n slug = (!slug_code_like slug_segment 1*(dash slug_segment)) as slug\n slug_identifier = {\n \"IALA \" slug [edition_human] [language_group]\n }\n identifier = {\n annex_identifier\n / plain_identifier\n / slug_identifier\n }\n publisher = [\"IALA \"]\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dash = \"-\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n type_letter -> type_letter (string)\n doc_number -> doc_number (string)\n dotted_segment -> doc_number_dots[].dotted_segment (string)\n subpart_number -> subpart[].subpart_number (string)\n edition_value -> edition_value (string)\n language -> language (string)\n annex_marker -> annex_marker (string)\n annex_letter -> annex_letter (string)\n slug -> slug (string)\n }\n\n test {\n accept \"G1040\"\n accept \"GA1040\"\n accept \"IALA S1070 Ed 2.0\"\n accept \"R1016:ed2.0(F)\"\n accept \"C0103-1 Ed 3.0\"\n accept \"IALA L2.1.11 Ed 2\"\n accept \"IALA G1128 Annex A Ed 1.6\"\n accept \"IALA G1045 Annex Ed 1\"\n accept \"IALA A12-01 (E)\"\n accept \"IALA arctic-seminar-report\"\n accept \"IALA 13th-vts-symposium-report (E)\"\n accept \"IALA iala-style-guide Ed 1.0 (E)\"\n reject \"nonsense\"\n reject \"arctic-seminar-report\"\n reject \"IALA Arctic-Seminar-Report\"\n reject \"IALA -arctic-seminar-report\"\n reject \"IALA arctic seminar report\"\n reject \"IALA arctic\"\n reject \"IALA arctic-\"\n reject \"IALA arctic--report\"\n reject \"IALA s1070\"\n reject \"IALA c0103-1\"\n reject \"IALA 1070 Ed 2.0\"\n example \"G1040\" { type_letter: \"G\", doc_number: \"1040\" }\n example \"GA01.01\" {\n type_letter: \"GA\",\n doc_number: \"01\",\n doc_number_dots: [ { dotted_segment: \"01\" } ],\n }\n example \"C0103-1\" {\n type_letter: \"C\",\n doc_number: \"0103\",\n subpart: [ { subpart_number: \"1\" } ],\n }\n example \"IALA S1070 Ed 2.0\" {\n type_letter: \"S\",\n doc_number: \"1070\",\n edition_value: \"2.0\",\n }\n example \"IALA G1128 Annex A Ed 1.6\" {\n type_letter: \"G\",\n doc_number: \"1128\",\n annex_marker: \"Annex\",\n annex_letter: \"A\",\n edition_value: \"1.6\",\n }\n example \"IALA arctic-seminar-report (E)\" {\n slug: \"arctic-seminar-report\",\n language: \"E\",\n }\n example \"IALA iala-world-wide-radio-navigation-plan Ed 2\" {\n slug: \"iala-world-wide-radio-navigation-plan\",\n edition_value: \"2\",\n }\n }\n}\n","source_hash":"ab620b92df8199a8ed6a1e34e270748e97596744c2fab91f27ee82c8add38825","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:35c2500510eb2381f7b589169862d6bca767259d9d75b349e0268eb318d70983","checksum":"sha256:000246eed8518ec3eebf2e2aab2fb113141bcbb18721f339511026067b805936","validated":{"lint_errors":0,"lint_warnings":3,"tests_total":30,"tests_failures":0,"self_test":true}}
@@ -9,8 +9,9 @@ obeys.
9
9
 
10
10
  ## Identifier space
11
11
 
12
- Every IALA publication carries a coded reference: a series prefix
13
- followed by a number whose shape varies per series.
12
+ Most IALA publications carry a coded reference: a series prefix
13
+ followed by a number whose shape varies per series. The rest carry no
14
+ code at all (see "Codeless publications" below).
14
15
 
15
16
  | Series | Type | Numbering | Example |
16
17
  |--------|------|-----------|---------|
@@ -24,6 +25,7 @@ followed by a number whose shape varies per series.
24
25
  | X | Report (reserved) | 4 digits | `IALA X0123` |
25
26
  | P | Resolution/Council publication (reserved) | 4 digits | `IALA P0123` |
26
27
  | — | Annex wrapper over any base | bare or lettered | `IALA G1128 ANNEX A Ed 1.6` |
28
+ | — | Publication (no code) | product-URL slug | `IALA arctic-seminar-report (E)` |
27
29
 
28
30
  The A letter is GeneralAssembly's legacy session form, not a separate
29
31
  series: all 11 A-shaped primary docidentifiers in relaton-data-iala
@@ -35,9 +37,56 @@ through to_s and the URN; there is no Advice type.
35
37
  The Annex class has no prefix of its own: it wraps a base identifier of
36
38
  another series and preserves the annex marker case (`Annex` vs `ANNEX`).
37
39
  X and P are reserved for future numbered series — today's reports and
38
- Council publications carry no code; unnumbered report/symposium
39
- documents exist in relaton-data-iala only as slug-form bibliographic
40
- records, deliberately outside this identifier space.
40
+ Council publications carry no code, and parse as `Publication`.
41
+
42
+ ## Codeless publications (`Identifiers::Publication`)
43
+
44
+ iala.int lists reports and proceedings, the style guide, history books,
45
+ questionnaires and radio plans with no code. relaton-data-iala gives
46
+ each one its product-URL slug as docid: `IALA <slug>[ Ed <x.y>][ (E)]`
47
+ (162 records, `spec/fixtures/iala/identifiers/pass/iala-publications.txt`).
48
+ These used to be "deliberately outside this identifier space".
49
+ relaton#604 removed that option: `relaton index` now fails on a document
50
+ that no pubid parse covers.
51
+
52
+ - **The slug is `number`.** It uses the inherited attribute, so
53
+ `root.number` (the relaton-index key) is the slug and `to_hash` is
54
+ `{_type: "pubid:iala:publication", number, edition?, language?}`. No
55
+ padding applies.
56
+ - **Grammar**: `slug_identifier` is the last alternative of
57
+ `identifier`, so every typed code keeps priority (`IALA G1164 Ed 1.1`
58
+ stays a Guideline). A typed code starts upper-case and a slug
59
+ lower-case or with a digit. The slug has no space, so it never takes
60
+ ` Ed …` or ` (E)`.
61
+ - **A slug is narrow on purpose**: two or more `[a-z0-9]` runs joined by
62
+ single hyphens (all 81 corpus slugs are), and the first run must not
63
+ look like a code (0–2 letters then digits). The first version took any
64
+ `[a-z0-9][a-z0-9-]*`, so `IALA s1070`, `IALA c0103-1` and
65
+ `IALA 1070 Ed 2.0` — typos of typed codes that used to raise — came
66
+ back as a `Publication` with a nil URN and an index key no row has:
67
+ a loud parse error turned into a quiet "no match".
68
+ - **The `IALA ` prefix is mandatory for a slug** (it is optional for a
69
+ typed code). Without it, any lower-case word would parse as IALA, and
70
+ `Pubid.parse` routing's `accepts_anything?` probe would then classify
71
+ IALA as an anything-goes flavor and stop trusting its fallback. The
72
+ cost: `to_s(with_publisher: false)` (`arctic-seminar-report (E)`) does
73
+ not parse back, unlike a typed code's (`G1164 Ed 1.1`).
74
+ - **`#to_urn` is nil.** `to_urn` is the organization's registered form,
75
+ and IALA assigns no MRN to these documents; an invented
76
+ `urn:mrn:iala:pub:<slug>` would also be ambiguous with the codes in
77
+ `UrnParser` (`guideline-…` against `g1164`). `#to_pubid_urn` names
78
+ them, and it escapes the first character of almost every slug
79
+ (`urn:pubid:iala:pub:~61rctic-seminar-report`): a `<word>-` core value
80
+ looks like an atom to the codec. It round-trips and is path-safe.
81
+ - **`to_mr_string` raises** for a Publication, as it already did for
82
+ every IALA id: the base `mr_edition` calls `edition.number` on IALA's
83
+ String edition (the BIPM/ASTM crash).
84
+ - **The grammar source is `pubid/pubid-grammar` `grammars/iala.parg`.**
85
+ `data/parg/iala.json` was baked locally from the changed source at
86
+ parsanol 1.5.1.0 under Ruby 3.4.8 (the CI pin: the unicode-table stamp
87
+ carries the baking Ruby, so a bake under another Ruby is not
88
+ byte-identical). A re-bake of the unchanged source under that pin
89
+ reproduced the previous artifact byte for byte.
41
90
 
42
91
  ## MRN URN scheme
43
92
 
@@ -8,6 +8,7 @@ module Pubid
8
8
  class Builder
9
9
  def build(parsed)
10
10
  return build_annex(parsed) if parsed[:annex_marker]
11
+ return build_publication(parsed) if parsed[:slug]
11
12
 
12
13
  type_letter = stringify(parsed[:type_letter])&.upcase
13
14
  klass = Iala.identifier_klass_for_type_letter(type_letter)
@@ -27,6 +28,18 @@ module Pubid
27
28
 
28
29
  private
29
30
 
31
+ # Build a codeless publication: the slug is its whole identity and
32
+ # goes into `number`, verbatim (no padding applies).
33
+ def build_publication(hash)
34
+ attrs = {
35
+ number: stringify(hash[:slug]),
36
+ edition: stringify(hash[:edition_value]),
37
+ language: stringify(hash[:language])&.upcase,
38
+ }.compact
39
+
40
+ Identifiers::Publication.new(**attrs)
41
+ end
42
+
30
43
  # Build the Annex wrapper from the bound map. The base composite in
31
44
  # the grammar stays unbound: its captures (type_letter, doc_number,
32
45
  # …) are the only occurrence of each name on the annex path, so the
@@ -9,11 +9,15 @@ module Pubid
9
9
  # IALA identifiers have the form:
10
10
  # [IALA ]{S|R|G|M|C|X|P}<4-digit number>[-<subpart>][ Ed <edition>][ (<LangLetter>)]
11
11
  #
12
+ # or, for a publication with no code (Identifiers::Publication):
13
+ # IALA <slug>[ Ed <edition>][ (<LangLetter>)]
14
+ #
12
15
  # Examples:
13
16
  # S1070
14
17
  # IALA S1070 Ed 2.0
15
18
  # R1016:ed2.0(F)
16
19
  # C0103-1 Ed 3.0
20
+ # IALA arctic-seminar-report (E)
17
21
  class Identifier < ::Pubid::Identifier
18
22
  # Parse an IALA identifier — human form ("IALA G1199 Ed 1.0") or
19
23
  # MRN URN ("urn:mrn:iala:pub:g1199:ed1.0") — into an identifier.
@@ -56,6 +60,7 @@ module Pubid
56
60
  "pubid:iala:annex" => "Pubid::Iala::Identifiers::Annex",
57
61
  "pubid:iala:report" => "Pubid::Iala::Identifiers::Report",
58
62
  "pubid:iala:resolution" => "Pubid::Iala::Identifiers::Resolution",
63
+ "pubid:iala:publication" => "Pubid::Iala::Identifiers::Publication",
59
64
  }.freeze
60
65
 
61
66
  key_value do
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iala
5
+ module Identifiers
6
+ # An IALA publication with no code: iala.int lists reports and
7
+ # proceedings, the style guide, history books and radio plans with
8
+ # no series letter or number, and its product-URL slug is the only
9
+ # identity the document has.
10
+ #
11
+ # The slug is held in the inherited `number` attribute, so it is
12
+ # also the index key (`root.number`) and serializes as `number`.
13
+ #
14
+ # Examples:
15
+ # IALA arctic-seminar-report
16
+ # IALA arctic-seminar-report (E)
17
+ # IALA iala-style-guide Ed 1.0 (E)
18
+ class Publication < Identifier
19
+ def self.type
20
+ { key: :publication, title: "Publication", short: nil }
21
+ end
22
+
23
+ # IALA assigns no MRN to a codeless publication, so it has no
24
+ # official URN; #to_pubid_urn still names it.
25
+ def to_urn
26
+ nil
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -13,6 +13,7 @@ module Pubid
13
13
  autoload :Letter, "#{__dir__}/identifiers/letter"
14
14
  autoload :Report, "#{__dir__}/identifiers/report"
15
15
  autoload :Resolution, "#{__dir__}/identifiers/resolution"
16
+ autoload :Publication, "#{__dir__}/identifiers/publication"
16
17
  end
17
18
  end
18
19
  end
@@ -20,6 +20,7 @@ module Pubid
20
20
  type "pubid:iala:letter", "letter"
21
21
  type "pubid:iala:manual", "manual"
22
22
  type "pubid:iala:model-course", "mc"
23
+ type "pubid:iala:publication", "pub"
23
24
  type "pubid:iala:recommendation", "rec"
24
25
  type "pubid:iala:report", "rpt"
25
26
  type "pubid:iala:resolution", "r"
@@ -8,12 +8,14 @@ module Pubid
8
8
  # "IALA S1070"
9
9
  # "IALA S1070 Ed 2.0"
10
10
  # "IALA R1016 Ed 2.0 (F)"
11
+ # "IALA arctic-seminar-report (E)"
11
12
  class Renderer < ::Pubid::Renderers::Base
12
13
  def render(context: nil, **_opts)
13
14
  id = @id
14
15
 
15
16
  return render_annex(id) if id.is_a?(Identifiers::Annex)
16
17
 
18
+ # A codeless Publication has no type letter: "IALA <slug>".
17
19
  rendered = "#{id.publisher} #{id.type_letter}#{id.number}"
18
20
  rendered << " Ed #{id.edition}" if id.edition
19
21
  rendered << " (#{id.language})" if id.language
data/lib/pubid/iala.rb CHANGED
@@ -62,12 +62,14 @@ module Pubid
62
62
 
63
63
  # Look up an identifier class by its IALA type letter (S, R, G, M,
64
64
  # C, X, P, GA) or a class-declared alias of one (GeneralAssembly
65
- # answers to the legacy "A" session letter).
65
+ # answers to the legacy "A" session letter). A class with no letter
66
+ # (Publication, the codeless form) is not in this table.
66
67
  # @param letter [String]
67
68
  # @return [Class<Identifier>]
68
69
  def self.identifier_klass_for_type_letter(letter)
69
70
  @by_letter ||= identifier_types.flat_map do |klass|
70
- ([klass.type[:short]] + Array(klass.type_letter_aliases)).map { |l| [l, klass] }
71
+ ([klass.type[:short]] + Array(klass.type_letter_aliases))
72
+ .compact.map { |l| [l, klass] }
71
73
  end.to_h
72
74
  @by_letter.fetch(letter.to_s.upcase)
73
75
  end
data/lib/pubid/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.49"
4
+ VERSION = "2.0.51"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.49
4
+ version: 2.0.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -675,6 +675,7 @@ files:
675
675
  - lib/pubid/iala/identifiers/letter.rb
676
676
  - lib/pubid/iala/identifiers/manual.rb
677
677
  - lib/pubid/iala/identifiers/model_course.rb
678
+ - lib/pubid/iala/identifiers/publication.rb
678
679
  - lib/pubid/iala/identifiers/recommendation.rb
679
680
  - lib/pubid/iala/identifiers/report.rb
680
681
  - lib/pubid/iala/identifiers/resolution.rb