pubid 2.0.0 → 2.0.2

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.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/data/parg/adobe.json +1 -1
  3. data/data/parg/aiee.json +1 -1
  4. data/data/parg/amca.json +1 -1
  5. data/data/parg/ansi.json +1 -1
  6. data/data/parg/api.json +1 -1
  7. data/data/parg/ashrae.json +1 -1
  8. data/data/parg/asme.json +1 -1
  9. data/data/parg/astm.json +1 -1
  10. data/data/parg/bipm.json +1 -1
  11. data/data/parg/bsi.json +1 -1
  12. data/data/parg/calconnect.json +1 -1
  13. data/data/parg/ccsds.json +1 -1
  14. data/data/parg/cen_cenelec.json +1 -1
  15. data/data/parg/cie.json +1 -1
  16. data/data/parg/csa.json +1 -1
  17. data/data/parg/doi.json +1 -1
  18. data/data/parg/easc.json +1 -1
  19. data/data/parg/ecma.json +1 -1
  20. data/data/parg/etsi.json +1 -1
  21. data/data/parg/evs.json +1 -1
  22. data/data/parg/gb.json +1 -1
  23. data/data/parg/gost.json +1 -1
  24. data/data/parg/iala.json +1 -1
  25. data/data/parg/iana.json +1 -1
  26. data/data/parg/idf.json +1 -1
  27. data/data/parg/iec.json +1 -1
  28. data/data/parg/ieee.json +1 -29571
  29. data/data/parg/ietf.json +1 -1
  30. data/data/parg/iho.json +1 -0
  31. data/data/parg/ire.json +1 -1
  32. data/data/parg/isbn.json +1 -1
  33. data/data/parg/iso.json +1 -8510
  34. data/data/parg/itu.json +1 -1
  35. data/data/parg/jcgm.json +1 -1
  36. data/data/parg/jis.json +1 -1
  37. data/data/parg/nesc.json +1 -1
  38. data/data/parg/nist.json +1 -9588
  39. data/data/parg/oasis.json +1 -1
  40. data/data/parg/ogc.json +1 -1
  41. data/data/parg/oiml.json +1 -1
  42. data/data/parg/omg.json +1 -1
  43. data/data/parg/parg.json +1 -1
  44. data/data/parg/plateau.json +1 -1
  45. data/data/parg/sae.json +1 -1
  46. data/data/parg/tables/typed_stages.yaml +1 -0
  47. data/data/parg/tgpp.json +1 -1
  48. data/data/parg/un.json +1 -1
  49. data/data/parg/w3c.json +1 -1
  50. data/data/parg/xsf.json +1 -1
  51. data/lib/pubid/adobe/identifier.rb +1 -1
  52. data/lib/pubid/adobe/parser.rb +2 -113
  53. data/lib/pubid/amca/identifiers/base.rb +1 -1
  54. data/lib/pubid/amca/parser.rb +1 -145
  55. data/lib/pubid/ansi/identifier.rb +1 -1
  56. data/lib/pubid/ansi/parser.rb +1 -82
  57. data/lib/pubid/api/builder.rb +32 -1
  58. data/lib/pubid/api/identifier.rb +1 -1
  59. data/lib/pubid/api/parser.rb +1 -131
  60. data/lib/pubid/ashrae/identifiers/base.rb +1 -1
  61. data/lib/pubid/ashrae/parser.rb +3 -710
  62. data/lib/pubid/asme/builder.rb +6 -4
  63. data/lib/pubid/asme/identifier.rb +1 -2
  64. data/lib/pubid/asme/parser.rb +1 -328
  65. data/lib/pubid/astm/builder.rb +12 -3
  66. data/lib/pubid/astm/identifier.rb +1 -2
  67. data/lib/pubid/astm/parser.rb +1 -227
  68. data/lib/pubid/bipm/identifier.rb +8 -1
  69. data/lib/pubid/bipm/parser.rb +2 -224
  70. data/lib/pubid/bsi/builder.rb +2 -4
  71. data/lib/pubid/bsi/parser.rb +1 -666
  72. data/lib/pubid/bsi/single_identifier.rb +38 -1
  73. data/lib/pubid/calconnect/identifier.rb +1 -1
  74. data/lib/pubid/calconnect/parser.rb +2 -40
  75. data/lib/pubid/ccsds/identifier.rb +1 -1
  76. data/lib/pubid/ccsds/parser.rb +1 -66
  77. data/lib/pubid/cen_cenelec/identifier.rb +16 -1
  78. data/lib/pubid/cen_cenelec/parser.rb +3 -136
  79. data/lib/pubid/cie/identifier.rb +1 -1
  80. data/lib/pubid/cie/parser.rb +3 -378
  81. data/lib/pubid/conformance.rb +1 -1
  82. data/lib/pubid/csa/builder.rb +41 -18
  83. data/lib/pubid/csa/identifier.rb +12 -4
  84. data/lib/pubid/csa/identifiers/amendment.rb +28 -0
  85. data/lib/pubid/csa/identifiers.rb +1 -0
  86. data/lib/pubid/csa/parser.rb +16 -397
  87. data/lib/pubid/doi/identifier.rb +1 -1
  88. data/lib/pubid/doi/parser.rb +2 -37
  89. data/lib/pubid/easc/builder.rb +1 -1
  90. data/lib/pubid/easc/identifier.rb +1 -1
  91. data/lib/pubid/easc/parser.rb +2 -70
  92. data/lib/pubid/ecma/CLAUDE.md +8 -1
  93. data/lib/pubid/ecma/identifier.rb +13 -8
  94. data/lib/pubid/ecma/parser.rb +2 -54
  95. data/lib/pubid/ecma/renderer.rb +3 -7
  96. data/lib/pubid/errors.rb +18 -13
  97. data/lib/pubid/etsi/builder.rb +8 -5
  98. data/lib/pubid/etsi/identifiers/base.rb +1 -1
  99. data/lib/pubid/etsi/parser.rb +1 -132
  100. data/lib/pubid/evs/identifier.rb +7 -0
  101. data/lib/pubid/evs/parser.rb +1 -8
  102. data/lib/pubid/evs.rb +1 -1
  103. data/lib/pubid/gb/identifier.rb +7 -1
  104. data/lib/pubid/gb/parser.rb +2 -51
  105. data/lib/pubid/gost/identifier.rb +9 -1
  106. data/lib/pubid/gost/parser.rb +4 -81
  107. data/lib/pubid/iala/parser.rb +2 -121
  108. data/lib/pubid/iana/identifier.rb +1 -1
  109. data/lib/pubid/iana/parser.rb +2 -24
  110. data/lib/pubid/identifier.rb +78 -1
  111. data/lib/pubid/idf/builder.rb +42 -0
  112. data/lib/pubid/idf/identifier.rb +1 -1
  113. data/lib/pubid/idf/parser.rb +1 -137
  114. data/lib/pubid/idf.rb +1 -2
  115. data/lib/pubid/iec/builder.rb +158 -50
  116. data/lib/pubid/iec/identifier.rb +1 -1
  117. data/lib/pubid/iec/parser.rb +3 -430
  118. data/lib/pubid/ieee/aiee/identifier.rb +2 -1
  119. data/lib/pubid/ieee/aiee.rb +0 -1
  120. data/lib/pubid/ieee/builder.rb +2 -2
  121. data/lib/pubid/ieee/identifiers/base.rb +1 -1
  122. data/lib/pubid/ieee/ire/identifier.rb +2 -1
  123. data/lib/pubid/ieee/ire.rb +0 -1
  124. data/lib/pubid/ieee/nesc.rb +0 -1
  125. data/lib/pubid/ieee/parser.rb +1 -1257
  126. data/lib/pubid/ietf/identifiers/base.rb +17 -1
  127. data/lib/pubid/ietf/parser.rb +2 -47
  128. data/lib/pubid/ietf/renderer.rb +17 -2
  129. data/lib/pubid/iho/CLAUDE.md +89 -0
  130. data/lib/pubid/iho/builder.rb +4 -1
  131. data/lib/pubid/iho/identifiers/base.rb +28 -2
  132. data/lib/pubid/iho/renderer.rb +8 -0
  133. data/lib/pubid/iho/urn_generator.rb +11 -1
  134. data/lib/pubid/iho/urn_parser.rb +21 -11
  135. data/lib/pubid/iho.rb +0 -1
  136. data/lib/pubid/isbn/identifier.rb +1 -1
  137. data/lib/pubid/isbn/parser.rb +2 -31
  138. data/lib/pubid/iso/builder.rb +1 -1
  139. data/lib/pubid/iso/identifiers/directives.rb +6 -3
  140. data/lib/pubid/iso/identifiers/guide.rb +6 -3
  141. data/lib/pubid/iso/identifiers/international_standard.rb +3 -1
  142. data/lib/pubid/iso/identifiers/international_workshop_agreement.rb +6 -3
  143. data/lib/pubid/iso/normalizer.rb +1 -1
  144. data/lib/pubid/iso/parser.rb +1 -539
  145. data/lib/pubid/iso/supplement_identifier.rb +6 -3
  146. data/lib/pubid/iso/utilities.rb +4 -5
  147. data/lib/pubid/iso.rb +1 -19
  148. data/lib/pubid/itu/builder.rb +36 -20
  149. data/lib/pubid/itu/identifiers/base.rb +15 -2
  150. data/lib/pubid/itu/parser.rb +1 -775
  151. data/lib/pubid/jcgm/builder.rb +35 -0
  152. data/lib/pubid/jcgm/parser.rb +1 -151
  153. data/lib/pubid/jcgm.rb +1 -2
  154. data/lib/pubid/jis/builder.rb +18 -29
  155. data/lib/pubid/jis/identifier.rb +1 -1
  156. data/lib/pubid/jis/parser.rb +1 -128
  157. data/lib/pubid/nist/builder.rb +5 -1
  158. data/lib/pubid/nist/caster.rb +13 -3
  159. data/lib/pubid/nist/identifiers/base.rb +37 -2
  160. data/lib/pubid/nist/identifiers/circular.rb +2 -2
  161. data/lib/pubid/nist/identifiers/circular_supplement.rb +2 -2
  162. data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +2 -2
  163. data/lib/pubid/nist/identifiers/crpl_report.rb +2 -2
  164. data/lib/pubid/nist/identifiers/handbook.rb +2 -2
  165. data/lib/pubid/nist/identifiers/internal_report.rb +2 -2
  166. data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +2 -2
  167. data/lib/pubid/nist/identifiers/monograph.rb +2 -2
  168. data/lib/pubid/nist/identifiers/report.rb +2 -2
  169. data/lib/pubid/nist/parser.rb +19 -775
  170. data/lib/pubid/nist/router.rb +4 -1
  171. data/lib/pubid/nist/supplement_identifier.rb +2 -2
  172. data/lib/pubid/oasis/identifier.rb +1 -1
  173. data/lib/pubid/oasis/parser.rb +2 -16
  174. data/lib/pubid/ogc/identifier.rb +1 -1
  175. data/lib/pubid/ogc/parser.rb +2 -26
  176. data/lib/pubid/oiml/identifiers/certification_system.rb +7 -0
  177. data/lib/pubid/oiml/identifiers/dual_published.rb +2 -2
  178. data/lib/pubid/oiml/parser.rb +1 -303
  179. data/lib/pubid/oiml.rb +1 -2
  180. data/lib/pubid/omg/identifier.rb +6 -1
  181. data/lib/pubid/omg/parser.rb +2 -76
  182. data/lib/pubid/parg/artifact.rb +22 -3
  183. data/lib/pubid/parg/model.rb +98 -0
  184. data/lib/pubid/parg.rb +1 -0
  185. data/lib/pubid/parser.rb +5 -4
  186. data/lib/pubid/parsers/mr_string.rb +1 -1
  187. data/lib/pubid/plateau/parser.rb +1 -66
  188. data/lib/pubid/plateau.rb +1 -2
  189. data/lib/pubid/renderers/directives_renderer.rb +1 -1
  190. data/lib/pubid/renderers/iwa_renderer.rb +1 -1
  191. data/lib/pubid/renderers/publisher_stripper.rb +82 -0
  192. data/lib/pubid/renderers/supplement_renderer.rb +1 -1
  193. data/lib/pubid/renderers.rb +1 -0
  194. data/lib/pubid/sae/identifiers/base.rb +1 -1
  195. data/lib/pubid/sae/parser.rb +1 -48
  196. data/lib/pubid/tgpp/identifier.rb +1 -1
  197. data/lib/pubid/tgpp/parser.rb +2 -59
  198. data/lib/pubid/un/identifier.rb +1 -1
  199. data/lib/pubid/un/parser.rb +1 -18
  200. data/lib/pubid/version.rb +1 -1
  201. data/lib/pubid/w3c/identifier.rb +1 -1
  202. data/lib/pubid/w3c/parser.rb +2 -27
  203. data/lib/pubid/xsf/identifier.rb +11 -7
  204. data/lib/pubid/xsf/parser.rb +3 -31
  205. data/lib/pubid/xsf/renderer.rb +2 -4
  206. data/lib/pubid.rb +8 -9
  207. metadata +15 -25
  208. data/lib/pubid/ieee/aiee/parser.rb +0 -130
  209. data/lib/pubid/ieee/ire/parser.rb +0 -109
  210. data/lib/pubid/ieee/nesc/parser.rb +0 -155
  211. data/lib/pubid/iho/parser.rb +0 -68
  212. data/lib/pubid/parser/common_parse_methods.rb +0 -13
  213. data/lib/pubid/parser/common_parse_rules.rb +0 -56
  214. data/lib/pubid/parser/grammar.rb +0 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df9d75ad9895a11d6e71d9530fd6e5bcb6a95711bd1ad4947d9045bd92b82e76
4
- data.tar.gz: 386549f25f92cfb9196b216fa89b483b2ef6c1bfd684fa641d003441a885c0ef
3
+ metadata.gz: e63056b353ea7108c6534d459fcf787121323150318ac6a739e74d012aa70ee1
4
+ data.tar.gz: c8fc6464b172356a66918e0fc92dacf937963eed8c4712b42aba89c3165d51f5
5
5
  SHA512:
6
- metadata.gz: cdf96eec36605731ced257eb250725da0348903e464a81babc4b4fac9d997ca6656fbdd099342202b6d89e61a3e4f5fbfd29985ff3bd4d3062dd92565418b182
7
- data.tar.gz: 76226ef278a9c59eaf448e657e40f6a1b50e720ed0da0f919ce25e2304cb4f9e3d621c0aff1d0f981229803e02f8cdfa35abee2fb18ecdd13954fa79caf77a54
6
+ metadata.gz: d62d14de32a0e709f387e8146f2bb4f88295cd172702e84f906f586af3744c21a0dd957581b25388364cd54b2a295ca44b500d48ecbb92417b0eb967bfe1be66
7
+ data.tar.gz: 2675f5ae5eef3819783f61f11e4260fb79bc6e7705ccda90ebc4ffa66120a17df2130b9922178e444358568723f947a545583f81f6c92a85a598e1f874ef4c61
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":48}},{"Entity":{"atom":30}},{"Entity":{"atom":9}},{"Str":{"pattern":"Adobe"}},{"Entity":{"atom":5}},{"Str":{"pattern":" "}},{"Str":{"pattern":"TN"}},{"Entity":{"atom":5}},{"Repetition":{"atom":7,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,4,6,8]}},{"Entity":{"atom":24}},{"Str":{"pattern":"Adobe"}},{"Entity":{"atom":5}},{"Str":{"pattern":"Technical"}},{"Entity":{"atom":5}},{"Str":{"pattern":"Note"}},{"Entity":{"atom":5}},{"Repetition":{"atom":16,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"#"}},{"Repetition":{"atom":18,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":5}},{"Repetition":{"atom":20,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[17,19,21]}},{"Repetition":{"atom":22,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[11,12,13,14,15,23]}},{"Entity":{"atom":29}},{"Str":{"pattern":"ATN"}},{"Entity":{"atom":5}},{"Repetition":{"atom":27,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[26,28]}},{"Alternative":{"atoms":[2,10,25]}},{"Entity":{"atom":32}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":31,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":33}},{"Entity":{"atom":36}},{"Str":{"pattern":"."}},{"Entity":{"atom":42}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[_]"}},{"Alternative":{"atoms":[38,39,40,41]}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"slug","atom":43}},{"Sequence":{"atoms":[35,44]}},{"Repetition":{"atom":45,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,34,46]}},{"Named":{"name":"tech_note","atom":47}},{"Entity":{"atom":53}},{"Entity":{"atom":32}},{"Repetition":{"atom":50,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":51}},{"Named":{"name":"tech_note_bare","atom":52}},{"Entity":{"atom":87}},{"Str":{"pattern":"Adobe Publication "}},{"Repetition":{"atom":55,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":86}},{"Entity":{"atom":82}},{"Entity":{"atom":75}},{"Entity":{"atom":69}},{"Entity":{"atom":62}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":61,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":67}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Alternative":{"atoms":[65,66]}},{"Repetition":{"atom":64,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[63,68]}},{"Entity":{"atom":71}},{"Str":{"pattern":"-"}},{"Entity":{"atom":69}},{"Sequence":{"atoms":[70,72]}},{"Repetition":{"atom":73,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[60,74]}},{"Named":{"name":"slug","atom":59}},{"Entity":{"atom":71}},{"Entity":{"atom":32}},{"Repetition":{"atom":78,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"version","atom":79}},{"Sequence":{"atoms":[76,77,80]}},{"Named":{"name":"publication_version","atom":81}},{"Entity":{"atom":85}},{"Entity":{"atom":75}},{"Named":{"name":"slug","atom":84}},{"Alternative":{"atoms":[58,83]}},{"Sequence":{"atoms":[56,57]}},{"Alternative":{"atoms":[0,49,54]}}],"root":88},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule tech_note_prefix: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule tech_note_prefix: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule tech_note_prefix: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","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\ngrammar PubidAdobe version \"0.1.0\" {\n tech_note_tn_prefix = \"Adobe\" space \"TN\" [space]\n tech_note_long_prefix = \"Adobe\" space \"Technical\" space \"Note\" [[space] [\"#\"] [space]]\n tech_note_atn_prefix = \"ATN\" [space]\n tech_note_prefix = tech_note_tn_prefix / tech_note_long_prefix / tech_note_atn_prefix\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.\n tech_note = (tech_note_prefix (1*digit) as number [(dot (1*slug_char) as slug)]) as tech_note\n bare_number = ((1*digit) as number) as tech_note_bare\n slug_segment = 1*lower1 *lowerd\n slug_text = slug_segment *(dash slug_segment)\n slug_inner = (slug_text) as slug\n publication_with_version = ((slug_text) as slug dash (1*digit) as version) as publication_version\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 slug_char = %x41-5A / %x61-7A / %x30-39 / %x5F\n lower1 = %x61-7A\n lowerd = %x61-7A / %x30-39\n digit = %x30-39\n space = \" \"\n dot = \".\"\n dash = \"-\"\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","source_hash":"bba8ad76fa85bcbf6363b8bfa1502a76a050fa4ca87bcf5a8bfd14a19cab9f5e","compiler_version":"1.3.93","checksum":"sha256:cef9c127759ddb05f7bd725d9bc923b6207c099dbd8a8e73ec4ae84101040361"}
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.3.114","edition":2,"checksum":"sha256:486c800991f44670fd0051fb210edb4bc38a04a017c3915261583982b00d3991"}
data/data/parg/aiee.json CHANGED
@@ -1 +1 @@
1
- {"bindings":null,"version":"0.1.0","grammar":"PubidAiee","shape":"parsanol-tree/v2","binding_version":1,"entries":{"aiee_identifier":{"root":"aiee_identifier","grammar":{"atoms":[{"Entity":{"atom":6}},{"Str":{"pattern":"IEEE-AIEE"}},{"Str":{"pattern":"A.I.E.E."}},{"Str":{"pattern":"A. I. E. E."}},{"Str":{"pattern":"AIEE"}},{"Alternative":{"atoms":[1,2,3,4]}},{"Named":{"name":"publisher","atom":5}},{"Entity":{"atom":8}},{"Str":{"pattern":" "}},{"Entity":{"atom":22}},{"Str":{"pattern":"Standard No."}},{"Str":{"pattern":"Standard No"}},{"Str":{"pattern":"Std No."}},{"Str":{"pattern":"Std No"}},{"Str":{"pattern":"Std"}},{"Str":{"pattern":"Nos"}},{"Str":{"pattern":"No."}},{"Str":{"pattern":"No"}},{"Str":{"pattern":"no"}},{"Str":{"pattern":"Standard"}},{"Str":{"pattern":"Trans."}},{"Alternative":{"atoms":[10,11,12,13,14,15,16,17,18,19,20]}},{"Named":{"name":"type","atom":21}},{"Entity":{"atom":8}},{"Sequence":{"atoms":[9,23]}},{"Repetition":{"atom":24,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":68}},{"Entity":{"atom":28}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":27,"min":2,"max":3,"tag":"Repetition"}},{"Entity":{"atom":31}},{"Str":{"pattern":"-"}},{"Entity":{"atom":35}},{"Entity":{"atom":34}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[29,30,32]}},{"Entity":{"atom":35}},{"Entity":{"atom":28}},{"Entity":{"atom":8}},{"Str":{"pattern":"and"}},{"Sequence":{"atoms":[39,40]}},{"Lookahead":{"atom":41,"positive":false}},{"Sequence":{"atoms":[37,38,42]}},{"Entity":{"atom":35}},{"Entity":{"atom":46}},{"Str":{"pattern":"."}},{"Entity":{"atom":35}},{"Sequence":{"atoms":[44,45,47]}},{"Entity":{"atom":35}},{"Named":{"name":"main_number","atom":49}},{"Entity":{"atom":8}},{"Str":{"pattern":"("}},{"Entity":{"atom":35}},{"Named":{"name":"alt_number","atom":53}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[52,54,55]}},{"Named":{"name":"parenthetical","atom":56}},{"Sequence":{"atoms":[50,51,57]}},{"Entity":{"atom":35}},{"Entity":{"atom":8}},{"Str":{"pattern":"and"}},{"Entity":{"atom":8}},{"Entity":{"atom":35}},{"Sequence":{"atoms":[60,61,62,63]}},{"Lookahead":{"atom":64,"positive":false}},{"Sequence":{"atoms":[59,65]}},{"Alternative":{"atoms":[36,43,48,58,66]}},{"Named":{"name":"number","atom":67}},{"Entity":{"atom":155}},{"Entity":{"atom":94}},{"Entity":{"atom":8}},{"Repetition":{"atom":71,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":31}},{"Entity":{"atom":92}},{"Str":{"pattern":"18"}},{"Entity":{"atom":34}},{"Repetition":{"atom":76,"min":2,"max":2,"tag":"Repetition"}},{"Sequence":{"atoms":[75,77]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"0"}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[80,81,82,83,84,85]}},{"Entity":{"atom":34}},{"Sequence":{"atoms":[79,86,87]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[89,90]}},{"Alternative":{"atoms":[78,88,91]}},{"Named":{"name":"year","atom":74}},{"Sequence":{"atoms":[72,73,93]}},{"Entity":{"atom":153}},{"Entity":{"atom":8}},{"Repetition":{"atom":96,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":","}},{"Entity":{"atom":46}},{"Alternative":{"atoms":[98,99]}},{"Named":{"name":"separator","atom":100}},{"Entity":{"atom":8}},{"Repetition":{"atom":102,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":129}},{"Str":{"pattern":"September"}},{"Str":{"pattern":"November"}},{"Str":{"pattern":"December"}},{"Str":{"pattern":"February"}},{"Str":{"pattern":"August"}},{"Str":{"pattern":"June"}},{"Str":{"pattern":"January"}},{"Str":{"pattern":"March"}},{"Str":{"pattern":"April"}},{"Str":{"pattern":"October"}},{"Str":{"pattern":"July"}},{"Str":{"pattern":"May"}},{"Str":{"pattern":"Sept"}},{"Str":{"pattern":"Jan"}},{"Str":{"pattern":"Feb"}},{"Str":{"pattern":"Mar"}},{"Str":{"pattern":"Apr"}},{"Str":{"pattern":"Jun"}},{"Str":{"pattern":"Jul"}},{"Str":{"pattern":"Aug"}},{"Str":{"pattern":"Sep"}},{"Str":{"pattern":"Oct"}},{"Str":{"pattern":"Nov"}},{"Str":{"pattern":"Dec"}},{"Alternative":{"atoms":[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]}},{"Named":{"name":"month","atom":104}},{"Entity":{"atom":8}},{"Sequence":{"atoms":[130,131]}},{"Repetition":{"atom":132,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":92}},{"Named":{"name":"year","atom":134}},{"Sequence":{"atoms":[101,103,133,135]}},{"Sequence":{"atoms":[97,136]}},{"Entity":{"atom":8}},{"Entity":{"atom":31}},{"Sequence":{"atoms":[138,139]}},{"Named":{"name":"separator","atom":140}},{"Entity":{"atom":8}},{"Repetition":{"atom":142,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":92}},{"Named":{"name":"year","atom":144}},{"Sequence":{"atoms":[141,143,145]}},{"Entity":{"atom":129}},{"Named":{"name":"month","atom":147}},{"Entity":{"atom":31}},{"Entity":{"atom":92}},{"Named":{"name":"year","atom":150}},{"Sequence":{"atoms":[148,149,151]}},{"Alternative":{"atoms":[137,146,152]}},{"Alternative":{"atoms":[70,95]}},{"Repetition":{"atom":154,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,7,25,26,69]}}],"root":156},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule year: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule year: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule year: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 1 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 1 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 2 and 23 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 3 and 24 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 4 and 15 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 5 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 5 and 17 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 5 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 11 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 11 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 8 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 8 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 9 and 17 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 9 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 10 and 22 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 11 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 11 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 11 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 12 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 13 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 14 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 14 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 17 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 18 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule date_long: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"aiee_identifier","render":{},"derive":{},"tests":[{"entry":"aiee_identifier","kind":"accept","input":"AIEE No. 56","expect":{}},{"entry":"aiee_identifier","kind":"accept","input":"AIEE Std 800","expect":{}},{"entry":"aiee_identifier","kind":"accept","input":"IEEE-AIEE No 18-1938","expect":{}},{"entry":"aiee_identifier","kind":"accept","input":"AIEE Standard 19","expect":{}},{"entry":"aiee_identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/ieee/aiee/parser.rb — AIEE (pre-IEEE) designations:\n# prefixes (IEEE-AIEE transitional, A.I.E.E. variants, AIEE), types\n# (Standard No./Std No./Nos/No/Trans.), numbers (letters-dash, dotted,\n# parenthetical alternates) and long/short dates. Consumed by the ieee\n# grammar via `use aiee`. Deviation: source \"Sep\"/\"Sept\" order is\n# lint-forced to longest-first.\n\ngrammar PubidAiee version \"0.1.0\" {\n digit = %x30-39\n upper = %x41-5A\n lower = %x61-7A\n digits = 1*digit\n space = \" \"\n dash = \"-\"\n dot = \".\"\n\n year = ((\"18\" 2digit)) / ((\"19\" (\"0\" / \"1\" / \"2\" / \"3\" / \"4\" / \"5\") digit)) / ((\"196\" %x30-33))\n month_name = \"September\" / \"November\" / \"December\" / \"February\" / \"August\" / \"June\" / \"January\" / \"March\" / \"April\" / \"October\" / \"July\" / \"May\" / \"Sept\" / \"Jan\" / \"Feb\" / \"Mar\" / \"Apr\" / \"Jun\" / \"Jul\" / \"Aug\" / \"Sep\" / \"Oct\" / \"Nov\" / \"Dec\"\n aiee_prefix = (\"IEEE-AIEE\" / \"A.I.E.E.\" / \"A. I. E. E.\" / \"AIEE\") as publisher\n aiee_type = (\"Standard No.\" / \"Standard No\" / \"Std No.\" / \"Std No\" / \"Std\" / \"Nos\" / \"No.\" / \"No\" / \"no\" / \"Standard\" / \"Trans.\") as type\n number = (((2*3upper dash digits)) / ((digits upper !((space \"and\")))) / ((digits dot digits)) / (((digits) as main_number space ((( \"(\" (digits) as alt_number \")\"))) as parenthetical)) / ((digits !((space \"and\" space digits))))) as number\n date_long = ([space] ((((\",\" / dot) as separator) [space] [((month_name) as month space)] (year) as year)) / (((space dash) as separator) [space] (year) as year) / (((month_name) as month dash (year) as year)))\n date_short = ([space] dash (year) as year)\n date = [(date_short / date_long)]\n\n aiee_identifier = aiee_prefix space [(aiee_type space)] number date\n\n entry aiee_identifier: aiee_identifier\n\n test {\n accept \"AIEE No. 56\"\n accept \"AIEE Std 800\"\n accept \"IEEE-AIEE No 18-1938\"\n accept \"AIEE Standard 19\"\n reject \"nonsense\"\n }\n}\n","source_hash":"4d858b677a096e55be57fc24b443cf2bef9b27648d8b4433523115189affca50","compiler_version":"1.3.93","checksum":"sha256:3214fb753c1e1fead5e52d03778b4718384039995d5841d3c11b2d84489a594b"}
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidAiee","shape":"parsanol-tree/v2","binding_version":1,"entries":{"aiee_identifier":{"root":"aiee_identifier","grammar":{"atoms":[{"Entity":{"atom":6}},{"Str":{"pattern":"IEEE-AIEE"}},{"Str":{"pattern":"A.I.E.E."}},{"Str":{"pattern":"A. I. E. E."}},{"Str":{"pattern":"AIEE"}},{"Alternative":{"atoms":[1,2,3,4]}},{"Named":{"name":"publisher","atom":5}},{"Entity":{"atom":8}},{"Str":{"pattern":" "}},{"Entity":{"atom":22}},{"Str":{"pattern":"Standard No."}},{"Str":{"pattern":"Standard No"}},{"Str":{"pattern":"Std No."}},{"Str":{"pattern":"Std No"}},{"Str":{"pattern":"Std"}},{"Str":{"pattern":"Nos"}},{"Str":{"pattern":"No."}},{"Str":{"pattern":"No"}},{"Str":{"pattern":"no"}},{"Str":{"pattern":"Standard"}},{"Str":{"pattern":"Trans."}},{"Alternative":{"atoms":[10,11,12,13,14,15,16,17,18,19,20]}},{"Named":{"name":"type","atom":21}},{"Entity":{"atom":8}},{"Sequence":{"atoms":[9,23]}},{"Repetition":{"atom":24,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":68}},{"Entity":{"atom":28}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":27,"min":2,"max":3,"tag":"Repetition"}},{"Entity":{"atom":31}},{"Str":{"pattern":"-"}},{"Entity":{"atom":35}},{"Entity":{"atom":34}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[29,30,32]}},{"Entity":{"atom":35}},{"Entity":{"atom":28}},{"Entity":{"atom":8}},{"Str":{"pattern":"and"}},{"Sequence":{"atoms":[39,40]}},{"Lookahead":{"atom":41,"positive":false}},{"Sequence":{"atoms":[37,38,42]}},{"Entity":{"atom":35}},{"Entity":{"atom":46}},{"Str":{"pattern":"."}},{"Entity":{"atom":35}},{"Sequence":{"atoms":[44,45,47]}},{"Entity":{"atom":35}},{"Named":{"name":"main_number","atom":49}},{"Entity":{"atom":8}},{"Str":{"pattern":"("}},{"Entity":{"atom":35}},{"Named":{"name":"alt_number","atom":53}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[52,54,55]}},{"Named":{"name":"parenthetical","atom":56}},{"Sequence":{"atoms":[50,51,57]}},{"Entity":{"atom":35}},{"Entity":{"atom":8}},{"Str":{"pattern":"and"}},{"Entity":{"atom":8}},{"Entity":{"atom":35}},{"Sequence":{"atoms":[60,61,62,63]}},{"Lookahead":{"atom":64,"positive":false}},{"Sequence":{"atoms":[59,65]}},{"Alternative":{"atoms":[36,43,48,58,66]}},{"Named":{"name":"number","atom":67}},{"Entity":{"atom":155}},{"Entity":{"atom":94}},{"Entity":{"atom":8}},{"Repetition":{"atom":71,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":31}},{"Entity":{"atom":92}},{"Str":{"pattern":"18"}},{"Entity":{"atom":34}},{"Repetition":{"atom":76,"min":2,"max":2,"tag":"Repetition"}},{"Sequence":{"atoms":[75,77]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"0"}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[80,81,82,83,84,85]}},{"Entity":{"atom":34}},{"Sequence":{"atoms":[79,86,87]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[89,90]}},{"Alternative":{"atoms":[78,88,91]}},{"Named":{"name":"year","atom":74}},{"Sequence":{"atoms":[72,73,93]}},{"Entity":{"atom":153}},{"Entity":{"atom":8}},{"Repetition":{"atom":96,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":","}},{"Entity":{"atom":46}},{"Alternative":{"atoms":[98,99]}},{"Named":{"name":"separator","atom":100}},{"Entity":{"atom":8}},{"Repetition":{"atom":102,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":129}},{"Str":{"pattern":"September"}},{"Str":{"pattern":"November"}},{"Str":{"pattern":"December"}},{"Str":{"pattern":"February"}},{"Str":{"pattern":"August"}},{"Str":{"pattern":"June"}},{"Str":{"pattern":"January"}},{"Str":{"pattern":"March"}},{"Str":{"pattern":"April"}},{"Str":{"pattern":"October"}},{"Str":{"pattern":"July"}},{"Str":{"pattern":"May"}},{"Str":{"pattern":"Sept"}},{"Str":{"pattern":"Jan"}},{"Str":{"pattern":"Feb"}},{"Str":{"pattern":"Mar"}},{"Str":{"pattern":"Apr"}},{"Str":{"pattern":"Jun"}},{"Str":{"pattern":"Jul"}},{"Str":{"pattern":"Aug"}},{"Str":{"pattern":"Sep"}},{"Str":{"pattern":"Oct"}},{"Str":{"pattern":"Nov"}},{"Str":{"pattern":"Dec"}},{"Alternative":{"atoms":[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]}},{"Named":{"name":"month","atom":104}},{"Entity":{"atom":8}},{"Sequence":{"atoms":[130,131]}},{"Repetition":{"atom":132,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":92}},{"Named":{"name":"year","atom":134}},{"Sequence":{"atoms":[101,103,133,135]}},{"Sequence":{"atoms":[97,136]}},{"Entity":{"atom":8}},{"Entity":{"atom":31}},{"Sequence":{"atoms":[138,139]}},{"Named":{"name":"separator","atom":140}},{"Entity":{"atom":8}},{"Repetition":{"atom":142,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":92}},{"Named":{"name":"year","atom":144}},{"Sequence":{"atoms":[141,143,145]}},{"Entity":{"atom":129}},{"Named":{"name":"month","atom":147}},{"Entity":{"atom":31}},{"Entity":{"atom":92}},{"Named":{"name":"year","atom":150}},{"Sequence":{"atoms":[148,149,151]}},{"Alternative":{"atoms":[137,146,152]}},{"Alternative":{"atoms":[70,95]}},{"Repetition":{"atom":154,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,7,25,26,69]}}],"root":156},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule year: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule year: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule year: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 1 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 1 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 2 and 23 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 3 and 24 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 4 and 15 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 5 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 5 and 17 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 5 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 11 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 6 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 11 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 7 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 8 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 8 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 9 and 17 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 9 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 10 and 22 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 11 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 11 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 11 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 12 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 13 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 14 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 14 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 17 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule month_name: branches 18 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule date_long: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"aiee_identifier","render":{},"derive":{},"tests":[{"entry":"aiee_identifier","kind":"accept","input":"AIEE No. 56","expect":{}},{"entry":"aiee_identifier","kind":"accept","input":"AIEE Std 800","expect":{}},{"entry":"aiee_identifier","kind":"accept","input":"IEEE-AIEE No 18-1938","expect":{}},{"entry":"aiee_identifier","kind":"accept","input":"AIEE Standard 19","expect":{}},{"entry":"aiee_identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/ieee/aiee/parser.rb — AIEE (pre-IEEE) designations:\n# prefixes (IEEE-AIEE transitional, A.I.E.E. variants, AIEE), types\n# (Standard No./Std No./Nos/No/Trans.), numbers (letters-dash, dotted,\n# parenthetical alternates) and long/short dates. Consumed by the ieee\n# grammar via `use aiee`. Deviation: source \"Sep\"/\"Sept\" order is\n# lint-forced to longest-first.\n\ngrammar PubidAiee version \"0.1.0\" mode \"v1\" {\n digit = %x30-39\n upper = %x41-5A\n lower = %x61-7A\n digits = 1*digit\n space = \" \"\n dash = \"-\"\n dot = \".\"\n\n year = ((\"18\" 2digit)) / ((\"19\" (\"0\" / \"1\" / \"2\" / \"3\" / \"4\" / \"5\") digit)) / ((\"196\" %x30-33))\n month_name = \"September\" / \"November\" / \"December\" / \"February\" / \"August\" / \"June\" / \"January\" / \"March\" / \"April\" / \"October\" / \"July\" / \"May\" / \"Sept\" / \"Jan\" / \"Feb\" / \"Mar\" / \"Apr\" / \"Jun\" / \"Jul\" / \"Aug\" / \"Sep\" / \"Oct\" / \"Nov\" / \"Dec\"\n aiee_prefix = (\"IEEE-AIEE\" / \"A.I.E.E.\" / \"A. I. E. E.\" / \"AIEE\") as publisher\n aiee_type = (\"Standard No.\" / \"Standard No\" / \"Std No.\" / \"Std No\" / \"Std\" / \"Nos\" / \"No.\" / \"No\" / \"no\" / \"Standard\" / \"Trans.\") as type\n number = (((2*3upper dash digits)) / ((digits upper !((space \"and\")))) / ((digits dot digits)) / (((digits) as main_number space ((( \"(\" (digits) as alt_number \")\"))) as parenthetical)) / ((digits !((space \"and\" space digits))))) as number\n date_long = ([space] ((((\",\" / dot) as separator) [space] [((month_name) as month space)] (year) as year)) / (((space dash) as separator) [space] (year) as year) / (((month_name) as month dash (year) as year)))\n date_short = ([space] dash (year) as year)\n date = [(date_short / date_long)]\n\n aiee_identifier = aiee_prefix space [(aiee_type space)] number date\n\n entry aiee_identifier: aiee_identifier\n\n test {\n accept \"AIEE No. 56\"\n accept \"AIEE Std 800\"\n accept \"IEEE-AIEE No 18-1938\"\n accept \"AIEE Standard 19\"\n reject \"nonsense\"\n }\n}\n","source_hash":"70f3b5bdeb64dc02d38cdc3d6883fedb678bd84a859f7a8b89ac8c7b6ecb30a6","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":1,"checksum":"sha256:ade8c8e340fdf90f8a0972550dbefbe3f409c0232fdc1f5c14e711fd30a700be"}
data/data/parg/amca.json CHANGED
@@ -1 +1 @@
1
- {"bindings":null,"version":"0.1.0","grammar":"PubidAmca","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":65}},{"Entity":{"atom":9}},{"Str":{"pattern":"ANSI"}},{"Entity":{"atom":4}},{"Str":{"pattern":"/"}},{"Str":{"pattern":"AMCA"}},{"Sequence":{"atoms":[2,3,5]}},{"Str":{"pattern":"AMCA"}},{"Alternative":{"atoms":[6,7]}},{"Named":{"name":"copublisher","atom":8}},{"Repetition":{"atom":1,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Str":{"pattern":" "}},{"Entity":{"atom":32}},{"Entity":{"atom":15}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":14,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":18}},{"Str":{"pattern":"-"}},{"Entity":{"atom":22}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[20,21]}},{"Sequence":{"atoms":[17,19]}},{"Repetition":{"atom":23,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":26}},{"Str":{"pattern":"."}},{"Entity":{"atom":15}},{"Repetition":{"atom":27,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[25,28]}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[16,24,30]}},{"Named":{"name":"code","atom":31}},{"Entity":{"atom":12}},{"Entity":{"atom":40}},{"Entity":{"atom":22}},{"Repetition":{"atom":35,"min":2,"max":null,"tag":"Repetition"}},{"Entity":{"atom":15}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[36,38]}},{"Named":{"name":"interpretation_code","atom":39}},{"Entity":{"atom":44}},{"Entity":{"atom":12}},{"Str":{"pattern":"Interp"}},{"Sequence":{"atoms":[42,43]}},{"Sequence":{"atoms":[34,41]}},{"Str":{"pattern":"–"}},{"Entity":{"atom":18}},{"Alternative":{"atoms":[46,47]}},{"Entity":{"atom":15}},{"Repetition":{"atom":49,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"interpretation_year","atom":50}},{"Entity":{"atom":44}},{"Repetition":{"atom":52,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[48,51,53]}},{"Alternative":{"atoms":[45,54]}},{"Sequence":{"atoms":[10,11,13,33,55]}},{"Named":{"name":"interpretation","atom":56}},{"Entity":{"atom":9}},{"Repetition":{"atom":58,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":32}},{"Entity":{"atom":44}},{"Sequence":{"atoms":[59,60,61,62]}},{"Named":{"name":"interpretation","atom":63}},{"Alternative":{"atoms":[57,64]}},{"Entity":{"atom":118}},{"Entity":{"atom":9}},{"Repetition":{"atom":67,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Str":{"pattern":"Publication"}},{"Named":{"name":"publication_keyword","atom":70}},{"Entity":{"atom":12}},{"Entity":{"atom":32}},{"Entity":{"atom":18}},{"Entity":{"atom":84}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[76,77]}},{"Entity":{"atom":15}},{"Repetition":{"atom":79,"min":2,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[78,80]}},{"Entity":{"atom":15}},{"Repetition":{"atom":82,"min":2,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[81,83]}},{"Named":{"name":"year","atom":75}},{"Sequence":{"atoms":[74,85]}},{"Repetition":{"atom":86,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":103}},{"Str":{"pattern":"("}},{"Str":{"pattern":"Rev"}},{"Entity":{"atom":26}},{"Repetition":{"atom":92,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":15}},{"Repetition":{"atom":95,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":18}},{"Entity":{"atom":15}},{"Repetition":{"atom":98,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[96,97,99]}},{"Named":{"name":"revision","atom":100}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[90,91,93,94,101,102]}},{"Sequence":{"atoms":[88,89]}},{"Repetition":{"atom":104,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":114}},{"Str":{"pattern":"("}},{"Str":{"pattern":"R"}},{"Entity":{"atom":15}},{"Repetition":{"atom":110,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"reaffirmed","atom":111}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[108,109,112,113]}},{"Sequence":{"atoms":[106,107]}},{"Repetition":{"atom":115,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[68,69,71,72,73,87,105,116]}},{"Named":{"name":"publication","atom":117}},{"Entity":{"atom":163}},{"Entity":{"atom":9}},{"Repetition":{"atom":120,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":126}},{"Str":{"pattern":"Standard"}},{"Str":{"pattern":"Publication"}},{"Alternative":{"atoms":[124,125]}},{"Named":{"name":"type","atom":123}},{"Repetition":{"atom":127,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Repetition":{"atom":129,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":32}},{"Entity":{"atom":18}},{"Entity":{"atom":84}},{"Named":{"name":"year","atom":133}},{"Sequence":{"atoms":[132,134]}},{"Repetition":{"atom":135,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":150}},{"Entity":{"atom":4}},{"Entity":{"atom":22}},{"Repetition":{"atom":140,"min":2,"max":10,"tag":"Repetition"}},{"Entity":{"atom":12}},{"Entity":{"atom":15}},{"Repetition":{"atom":143,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":18}},{"Entity":{"atom":15}},{"Repetition":{"atom":146,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[145,147]}},{"Repetition":{"atom":148,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[139,141,142,144,149]}},{"Sequence":{"atoms":[137,138]}},{"Repetition":{"atom":151,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":156}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[154,155]}},{"Repetition":{"atom":153,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":12}},{"Entity":{"atom":114}},{"Sequence":{"atoms":[158,159]}},{"Repetition":{"atom":160,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[121,122,128,130,131,136,152,157,161]}},{"Named":{"name":"standard","atom":162}},{"Alternative":{"atoms":[0,66,119]}}],"root":164},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule interpretation_identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","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)","rule year_digits: 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":"AMCA 500-D","expect":{}},{"entry":"identifier","kind":"accept","input":"AMCA Standard 210","expect":{}},{"entry":"identifier","kind":"accept","input":"ANSI/AMCA 210","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/amca/parser.rb. Pre-parse whitespace collapsing,\n# en-dash normalization and trailing punctuation stripping stay\n# binder-side.\n\ngrammar PubidAmca version \"0.1.0\" {\n copublisher = ((\"ANSI\" slash \"AMCA\") / \"AMCA\") as copublisher\n additional_copublisher = slash 2*10letter space 1*digit [(dash 1*digit)]\n code = (1*digit [(dash letter)] [(dot 1*digit)]) as code\n type = \"Standard\" / \"Publication\"\n reaffirmation = \"(\" \"R\" (1*digit) as reaffirmed \")\"\n suffix = \"R\" / \"P\"\n revision = \"(\" \"Rev\" [dot] space (1*digit dash 1*digit) as revision \")\"\n interpretation_code = (2*letter / 1*digit) as interpretation_code\n interp_keyword = space \"Interp\"\n interpretation_identifier = (([copublisher] space code space ((interpretation_code interp_keyword) / ((\"–\" / dash) 1*digit as interpretation_year [interp_keyword]))) as interpretation) / (([copublisher] space code interp_keyword) as interpretation)\n publication_identifier = (([copublisher] space \"Publication\" as publication_keyword space code [(dash year_digits as year)] [(space revision)] [(space reaffirmation)]) as publication)\n standard_identifier = (([copublisher] space [type as type] [space] code [(dash year_digits as year)] [(space additional_copublisher)] [suffix] [(space reaffirmation)]) as standard)\n identifier = interpretation_identifier / publication_identifier / standard_identifier\n year_digits = ((\"19\" / \"20\") 2*digit / 2*digit)\n letter = %x41-5A / %x61-7A\n digit = %x30-39\n dash = \"-\"\n dot = \".\"\n slash = \"/\"\n space = \" \"\n entry identifier: identifier\n\n test {\n accept \"AMCA 500-D\"\n accept \"AMCA Standard 210\"\n accept \"ANSI/AMCA 210\"\n reject \"nonsense\"\n }\n}\n","source_hash":"ac95e8697ba2f8fd5e272a80b7fa3705cfac6e9efac3bd4e7fc9630cb3ebb30a","compiler_version":"1.3.93","checksum":"sha256:9774e9505d23cef48fe63e1caeea198ca729e4f200f1a95ff0607d04036b4c42"}
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidAmca","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":62}},{"Entity":{"atom":8}},{"Str":{"pattern":"ANSI"}},{"Str":{"pattern":"/"}},{"Str":{"pattern":"AMCA"}},{"Sequence":{"atoms":[2,3,4]}},{"Str":{"pattern":"AMCA"}},{"Alternative":{"atoms":[5,6]}},{"Named":{"name":"copublisher","atom":7}},{"Repetition":{"atom":1,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":26}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":12,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[15,16]}},{"Sequence":{"atoms":[14,17]}},{"Repetition":{"atom":18,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":21,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[20,22]}},{"Repetition":{"atom":23,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[13,19,24]}},{"Named":{"name":"code","atom":25}},{"Str":{"pattern":" "}},{"Entity":{"atom":36}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[29,30]}},{"Repetition":{"atom":31,"min":2,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[32,34]}},{"Named":{"name":"interpretation_code","atom":35}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Interp"}},{"Sequence":{"atoms":[28,37,38]}},{"Str":{"pattern":"–"}},{"Str":{"pattern":"-"}},{"Alternative":{"atoms":[40,41]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":43,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"interpretation_year","atom":44}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Interp"}},{"Sequence":{"atoms":[46,47]}},{"Repetition":{"atom":48,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[42,45,49]}},{"Alternative":{"atoms":[39,50]}},{"Sequence":{"atoms":[9,10,11,27,51]}},{"Named":{"name":"interpretation","atom":52}},{"Entity":{"atom":8}},{"Repetition":{"atom":54,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":26}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Interp"}},{"Sequence":{"atoms":[55,56,57,58,59]}},{"Named":{"name":"interpretation","atom":60}},{"Alternative":{"atoms":[53,61]}},{"Entity":{"atom":114}},{"Entity":{"atom":8}},{"Repetition":{"atom":64,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Publication"}},{"Named":{"name":"publication_keyword","atom":67}},{"Str":{"pattern":" "}},{"Entity":{"atom":26}},{"Str":{"pattern":"-"}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[72,73]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":75,"min":2,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[74,76]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":78,"min":2,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[77,79]}},{"Named":{"name":"year","atom":80}},{"Sequence":{"atoms":[71,81]}},{"Repetition":{"atom":82,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":99}},{"Str":{"pattern":"("}},{"Str":{"pattern":"Rev"}},{"Str":{"pattern":"."}},{"Repetition":{"atom":88,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":91,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":94,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[92,93,95]}},{"Named":{"name":"revision","atom":96}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[86,87,89,90,97,98]}},{"Sequence":{"atoms":[84,85]}},{"Repetition":{"atom":100,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":110}},{"Str":{"pattern":"("}},{"Str":{"pattern":"R"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":106,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"reaffirmed","atom":107}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[104,105,108,109]}},{"Sequence":{"atoms":[102,103]}},{"Repetition":{"atom":111,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[65,66,68,69,70,83,101,112]}},{"Named":{"name":"publication","atom":113}},{"Entity":{"atom":165}},{"Entity":{"atom":8}},{"Repetition":{"atom":116,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Standard"}},{"Str":{"pattern":"Publication"}},{"Alternative":{"atoms":[119,120]}},{"Named":{"name":"type","atom":121}},{"Repetition":{"atom":122,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":124,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":26}},{"Str":{"pattern":"-"}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[128,129]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":131,"min":2,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[130,132]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":134,"min":2,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[133,135]}},{"Named":{"name":"year","atom":136}},{"Sequence":{"atoms":[127,137]}},{"Repetition":{"atom":138,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"/"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[142,143]}},{"Repetition":{"atom":144,"min":2,"max":10,"tag":"Repetition"}},{"Str":{"pattern":" "}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":147,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":150,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[149,151]}},{"Repetition":{"atom":152,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[140,141,145,146,148,153]}},{"Repetition":{"atom":154,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[156,157]}},{"Repetition":{"atom":158,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":110}},{"Sequence":{"atoms":[160,161]}},{"Repetition":{"atom":162,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[117,118,123,125,126,139,155,159,163]}},{"Named":{"name":"standard","atom":164}},{"Alternative":{"atoms":[0,63,115]}}],"root":166},"bindings":[{"capture":"interpretation","path":"interpretation","type":"raw","card":null,"preprocess":null},{"capture":"copublisher","path":"copublisher","type":"string","card":null,"preprocess":null},{"capture":"code","path":"code","type":"string","card":null,"preprocess":null},{"capture":"type","path":"type","type":"string","card":null,"preprocess":null},{"capture":"reaffirmed","path":"reaffirmed","type":"string","card":null,"preprocess":null},{"capture":"revision","path":"revision","type":"string","card":null,"preprocess":null},{"capture":"interpretation_code","path":"interpretation_code","type":"string","card":null,"preprocess":null},{"capture":"interpretation_year","path":"interpretation_year","type":"string","card":null,"preprocess":null},{"capture":"publication_keyword","path":"publication_keyword","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule interpretation_identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","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":"AMCA 500-D","expect":{}},{"entry":"identifier","kind":"accept","input":"AMCA Standard 210","expect":{}},{"entry":"identifier","kind":"accept","input":"ANSI/AMCA 210","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/amca/parser.rb. Pre-parse whitespace collapsing,\n# en-dash normalization and trailing punctuation stripping stay\n# binder-side.\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); references to rules\n# that themselves capture (copublisher, code, reaffirmation) float their\n# captures unchanged. The type wrappers (interpretation, publication,\n# standard) keep the v1 tree shape and the bindings name the scalar\n# leaves.\n\ngrammar PubidAmca version \"0.1.0\" edition 2 {\n copublisher = ((\"ANSI\" \"/\" \"AMCA\") / \"AMCA\") as copublisher\n code = {\n ( 1*%x30-39\n [(\"-\" (%x41-5A / %x61-7A))]\n [(\".\" 1*%x30-39)] ) as code\n }\n reaffirmation = \"(\" \"R\" (1*%x30-39) as reaffirmed \")\"\n revision = \"(\" \"Rev\" [\".\"] \" \" (1*%x30-39 \"-\" 1*%x30-39) as revision \")\"\n interpretation_code = (2*(%x41-5A / %x61-7A) / 1*%x30-39) as interpretation_code\n\n interpretation_identifier = {\n (\n ( [copublisher] \" \" code \" \"\n ( (interpretation_code \" \" \"Interp\")\n / ((\"–\" / \"-\") (1*%x30-39) as interpretation_year [\" \" \"Interp\"]) )\n ) as interpretation\n )\n /\n (\n ( [copublisher] \" \" code \" \" \"Interp\" ) as interpretation\n )\n }\n publication_identifier = {\n (\n ( [copublisher] \" \" \"Publication\" as publication_keyword \" \" code\n [(\"-\" (((\"19\" / \"20\") 2*%x30-39) / (2*%x30-39)) as year)]\n [(\" \" revision)]\n [(\" \" reaffirmation)] ) as publication\n )\n }\n standard_identifier = {\n (\n ( [copublisher] \" \" [(\"Standard\" / \"Publication\") as type] [\" \"] code\n [(\"-\" (((\"19\" / \"20\") 2*%x30-39) / (2*%x30-39)) as year)]\n [(\" \" \"/\" 2*10(%x41-5A / %x61-7A) \" \" 1*%x30-39 [(\"-\" 1*%x30-39)])]\n [(\"R\" / \"P\")]\n [(\" \" reaffirmation)] ) as standard\n )\n }\n identifier = interpretation_identifier / publication_identifier / standard_identifier\n\n entry identifier: identifier\n\n test {\n accept \"AMCA 500-D\"\n accept \"AMCA Standard 210\"\n accept \"ANSI/AMCA 210\"\n reject \"nonsense\"\n }\n\n bindings identifier {\n # The builder dispatches interpretation on the :interpretation wrapper\n # when the code/keyword leaves are absent (branch 2 spellings), so the\n # wrapper binds raw — the nested hash build_interpretation walks.\n interpretation -> interpretation (raw)\n copublisher -> copublisher (string)\n code -> code (string)\n type -> type (string)\n reaffirmed -> reaffirmed (string)\n revision -> revision (string)\n interpretation_code -> interpretation_code (string)\n interpretation_year -> interpretation_year (string)\n publication_keyword -> publication_keyword (string)\n year -> year (string)\n }\n}\n","source_hash":"bceecc759a9fa419b558c9df856323bc3c9ca9d0e3ebccde9ed6a37695794a9c","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":2,"checksum":"sha256:e10abef95a553ac47069d7971ae622b25fe12b6e2ba731bfec957cfc7afc7117"}
data/data/parg/ansi.json CHANGED
@@ -1 +1 @@
1
- {"bindings":null,"version":"0.1.0","grammar":"PubidAnsi","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":98}},{"Str":{"pattern":"ANSI"}},{"Named":{"name":"publisher","atom":1}},{"Entity":{"atom":21}},{"Entity":{"atom":19}},{"Entity":{"atom":6}},{"Str":{"pattern":"/"}},{"Entity":{"atom":8}},{"Str":{"pattern":" "}},{"Repetition":{"atom":7,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":17}},{"Str":{"pattern":"ISO"}},{"Str":{"pattern":"IEC"}},{"Str":{"pattern":"IEEE"}},{"Str":{"pattern":"SAE"}},{"Str":{"pattern":"ASME"}},{"Str":{"pattern":"ASTM"}},{"Alternative":{"atoms":[11,12,13,14,15,16]}},{"Named":{"name":"copublisher","atom":10}},{"Sequence":{"atoms":[5,9,18]}},{"Repetition":{"atom":4,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"copublishers","atom":20}},{"Entity":{"atom":8}},{"Entity":{"atom":25}},{"Str":{"pattern":"Std "}},{"Repetition":{"atom":24,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":69}},{"Entity":{"atom":49}},{"Entity":{"atom":29}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":28,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":32}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":31,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":35}},{"Str":{"pattern":"."}},{"Entity":{"atom":32}},{"Repetition":{"atom":36,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[34,37]}},{"Repetition":{"atom":38,"min":0,"max":3,"tag":"Repetition"}},{"Entity":{"atom":29}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Repetition"}},{"Repetition":{"atom":41,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":44}},{"Str":{"pattern":"-"}},{"Entity":{"atom":32}},{"Repetition":{"atom":45,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[43,46]}},{"Repetition":{"atom":47,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[30,33,39,42,48]}},{"Entity":{"atom":67}},{"Entity":{"atom":32}},{"Repetition":{"atom":51,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":35}},{"Entity":{"atom":32}},{"Repetition":{"atom":54,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":57}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":56,"min":0,"max":1,"tag":"Repetition"}},{"Repetition":{"atom":58,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[53,55,59]}},{"Repetition":{"atom":60,"min":0,"max":2,"tag":"Repetition"}},{"Entity":{"atom":44}},{"Entity":{"atom":32}},{"Repetition":{"atom":63,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[62,64]}},{"Repetition":{"atom":65,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[52,61,66]}},{"Alternative":{"atoms":[27,50]}},{"Named":{"name":"number_with_part","atom":68}},{"Entity":{"atom":83}},{"Entity":{"atom":72}},{"Str":{"pattern":":"}},{"Entity":{"atom":81}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[74,75]}},{"Entity":{"atom":32}},{"Repetition":{"atom":77,"min":2,"max":null,"tag":"Repetition"}},{"Entity":{"atom":32}},{"Lookahead":{"atom":79,"positive":false}},{"Sequence":{"atoms":[76,78,80]}},{"Named":{"name":"date","atom":73}},{"Sequence":{"atoms":[71,82]}},{"Repetition":{"atom":70,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":96}},{"Str":{"pattern":"("}},{"Entity":{"atom":94}},{"Entity":{"atom":57}},{"Repetition":{"atom":88,"min":2,"max":null,"tag":"Repetition"}},{"Str":{"pattern":","}},{"Repetition":{"atom":90,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[89,91]}},{"Repetition":{"atom":92,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"languages","atom":93}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[86,87,95]}},{"Repetition":{"atom":85,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[2,3,22,23,26,84,97]}},{"Entity":{"atom":109}},{"Str":{"pattern":"ANSI"}},{"Named":{"name":"publisher","atom":100}},{"Entity":{"atom":8}},{"Entity":{"atom":25}},{"Entity":{"atom":69}},{"Entity":{"atom":83}},{"Repetition":{"atom":105,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":96}},{"Repetition":{"atom":107,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[101,102,103,104,106,108]}},{"Alternative":{"atoms":[0,99]}}],"root":110},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule organization: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule organization: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule organization: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule organization: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","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":"ANSI C63.4","expect":{}},{"entry":"identifier","kind":"accept","input":"ANSI/IEEE C63.4","expect":{}},{"entry":"identifier","kind":"accept","input":"ANSI Std A119.1","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/ansi/parser.rb: ANSI [copublishers] [Std] number\n# [:year][(languages)]. The number alternatives cover letter-prefixed\n# forms (C37.06.1, N323A) and plain dotted forms (802.1b-1995).\n\ngrammar PubidAnsi version \"0.1.0\" {\n organization = \"ISO\" / \"IEC\" / \"IEEE\" / \"SAE\" / \"ASME\" / \"ASTM\"\n copublisher_item = slash [space] organization as copublisher\n copublishers = (1*copublisher_item) as copublishers\n std_keyword = [\"Std \"]\n letter_head_part = 1*upper 1*digit *3(dot 1*digit) [*1upper] [(dash 1*digit)]\n plain_part = 1*digit *2(dot 1*digit [*1lower]) [(dash 1*digit)]\n number_with_part = (letter_head_part / plain_part) as number_with_part\n date = colon year_digits as date\n year_digits = (\"19\" / \"20\") 2*digit !digit\n languages = (*(2*lower [\",\"])) as languages\n language = \"(\" languages \")\"\n identifier_with_copublishers = \"ANSI\" as publisher copublishers space std_keyword number_with_part [date] [language]\n identifier_sole = \"ANSI\" as publisher space std_keyword number_with_part [date] [language]\n identifier = identifier_with_copublishers / identifier_sole\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dot = \".\"\n dash = \"-\"\n colon = \":\"\n slash = \"/\"\n space = \" \"\n entry identifier: identifier\n\n test {\n accept \"ANSI C63.4\"\n accept \"ANSI/IEEE C63.4\"\n accept \"ANSI Std A119.1\"\n reject \"nonsense\"\n }\n}\n","source_hash":"18970403b92640703c0de08ee58342989968b026ebd14c80f72928cff1b65dbb","compiler_version":"1.3.93","checksum":"sha256:6b5eb0fa0e4f1ff4e061b4fd8e17d8b468737b3e87b9797b14940e19199cc1ac"}
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidAnsi","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":85}},{"Str":{"pattern":"ANSI"}},{"Named":{"name":"publisher","atom":1}},{"Entity":{"atom":18}},{"Entity":{"atom":16}},{"Str":{"pattern":"/"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":6,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"ISO"}},{"Str":{"pattern":"IEC"}},{"Str":{"pattern":"IEEE"}},{"Str":{"pattern":"SAE"}},{"Str":{"pattern":"ASME"}},{"Str":{"pattern":"ASTM"}},{"Alternative":{"atoms":[8,9,10,11,12,13]}},{"Named":{"name":"copublisher","atom":14}},{"Sequence":{"atoms":[5,7,15]}},{"Repetition":{"atom":4,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"copublishers","atom":17}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Std "}},{"Repetition":{"atom":20,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":58}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":23,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":25,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":28,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[27,29]}},{"Repetition":{"atom":30,"min":0,"max":3,"tag":"Repetition"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":32,"min":0,"max":1,"tag":"Repetition"}},{"Repetition":{"atom":33,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":36,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[35,37]}},{"Repetition":{"atom":38,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[24,26,31,34,39]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":41,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":44,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Repetition"}},{"Repetition":{"atom":47,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[43,45,48]}},{"Repetition":{"atom":49,"min":0,"max":2,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":52,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[51,53]}},{"Repetition":{"atom":54,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[42,50,55]}},{"Alternative":{"atoms":[40,56]}},{"Named":{"name":"number_with_part","atom":57}},{"Entity":{"atom":70}},{"Str":{"pattern":":"}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[61,62]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":64,"min":2,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Lookahead":{"atom":66,"positive":false}},{"Sequence":{"atoms":[63,65,67]}},{"Named":{"name":"date","atom":68}},{"Sequence":{"atoms":[60,69]}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":83}},{"Str":{"pattern":"("}},{"Entity":{"atom":81}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":75,"min":2,"max":null,"tag":"Repetition"}},{"Str":{"pattern":","}},{"Repetition":{"atom":77,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[76,78]}},{"Repetition":{"atom":79,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"languages","atom":80}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[73,74,82]}},{"Repetition":{"atom":72,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[2,3,19,21,22,71,84]}},{"Entity":{"atom":97}},{"Str":{"pattern":"ANSI"}},{"Named":{"name":"publisher","atom":87}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Std "}},{"Repetition":{"atom":90,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":58}},{"Entity":{"atom":70}},{"Repetition":{"atom":93,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":83}},{"Repetition":{"atom":95,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[88,89,91,92,94,96]}},{"Alternative":{"atoms":[0,86]}}],"root":98},"bindings":[{"capture":"publisher","path":"publisher","type":"string","card":null,"preprocess":null},{"capture":"copublisher","path":"copublishers[].copublisher","type":"string","card":null,"preprocess":null},{"capture":"number_with_part","path":"number_with_part","type":"string","card":null,"preprocess":null},{"capture":"date","path":"date","type":"string","card":null,"preprocess":null},{"capture":"languages","path":"languages","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule organization: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule organization: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule organization: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule organization: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","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":"ANSI C63.4","expect":{}},{"entry":"identifier","kind":"accept","input":"ANSI/IEEE C63.4","expect":{}},{"entry":"identifier","kind":"accept","input":"ANSI Std A119.1","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/ansi/parser.rb: ANSI [copublishers] [Std] number\n# [:year][(languages)]. The number alternatives cover letter-prefixed\n# forms (C37.06.1, N323A) and plain dotted forms (802.1b-1995).\n#\n# Edition-2 notes: letter_head_part / plain_part / year_digits bodies are\n# inlined at the capture sites (a capture wrapping a rule ref expands to\n# element hashes, while the inlined body binds as one scalar string).\n# The copublishers wrapper stays a capture so the tree keeps the\n# {copublishers: [...]} shape the builder reads; the repeats collect by\n# occurrence under copublishers[].copublisher.\n\ngrammar PubidAnsi version \"0.1.0\" edition 2 {\n organization = \"ISO\" / \"IEC\" / \"IEEE\" / \"SAE\" / \"ASME\" / \"ASTM\"\n # The copublisher body is inlined to raw terms: bare rule refs next to\n # a capture drop the capture or materialize stray {slash:} nodes.\n copublisher_item = \"/\" [\" \"] ( \"ISO\" / \"IEC\" / \"IEEE\" / \"SAE\" / \"ASME\" / \"ASTM\" ) as copublisher\n copublishers = ( 1*copublisher_item ) as copublishers\n std_keyword = [\"Std \"]\n number_with_part = {\n (\n ( 1*(%x41-5A) 1*(%x30-39) *3(\".\" 1*(%x30-39)) [*1(%x41-5A)] [(\"-\" 1*(%x30-39))] )\n / ( 1*(%x30-39) *2(\".\" 1*(%x30-39) [*1(%x61-7A)]) [(\"-\" 1*(%x30-39))] )\n ) as number_with_part\n }\n date = \":\" ( (\"19\" / \"20\") 2*(%x30-39) !(%x30-39) ) as date\n languages = ( *( 2*(%x61-7A) [\",\"] ) ) as languages\n language = \"(\" languages \")\"\n identifier_with_copublishers = {\n \"ANSI\" as publisher copublishers \" \" [\"Std \"] number_with_part [date] [language]\n }\n identifier_sole = {\n \"ANSI\" as publisher \" \" [\"Std \"] number_with_part [date] [language]\n }\n identifier = identifier_with_copublishers / identifier_sole\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dot = \".\"\n dash = \"-\"\n colon = \":\"\n slash = \"/\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n publisher -> publisher (string)\n copublisher -> copublishers[].copublisher (string)\n number_with_part -> number_with_part (string)\n date -> date (string)\n languages -> languages (string)\n }\n\n test {\n accept \"ANSI C63.4\"\n accept \"ANSI/IEEE C63.4\"\n accept \"ANSI Std A119.1\"\n reject \"nonsense\"\n }\n}\n","source_hash":"7af31e7ba304c87eeb0d2ca1b94e534831a333153e1cb8db789e7c55eda6cc07","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":2,"checksum":"sha256:15829b9bd64dd973c426ac0b775a838d1d7a509456914ed84160d04afd99b716"}
data/data/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.114","edition":2,"checksum":"sha256:abbd738631183d0431f8e283a7c0f5646b096593d40edd6556ab962e2f26dc95"}