pubid 2.0.1 → 2.0.3

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 (216) hide show
  1. checksums.yaml +4 -4
  2. data/data/ieee/update_codes.yaml +2 -2
  3. data/data/parg/adobe.json +1 -1
  4. data/data/parg/aiee.json +1 -1
  5. data/data/parg/aiee.parg +99 -9
  6. data/data/parg/amca.json +1 -1
  7. data/data/parg/ansi.json +1 -1
  8. data/data/parg/api.json +1 -1
  9. data/data/parg/ashrae.json +1 -1
  10. data/data/parg/asme.json +1 -1
  11. data/data/parg/astm.json +1 -1
  12. data/data/parg/bipm.json +1 -1
  13. data/data/parg/bsi.json +1 -1
  14. data/data/parg/ccsds.json +1 -1
  15. data/data/parg/cen_cenelec.json +1 -1
  16. data/data/parg/cie.json +1 -1
  17. data/data/parg/csa.json +1 -1
  18. data/data/parg/ecma.json +1 -1
  19. data/data/parg/etsi.json +1 -1
  20. data/data/parg/evs.json +1 -1
  21. data/data/parg/gost.json +1 -1
  22. data/data/parg/iala.json +1 -1
  23. data/data/parg/iana.json +1 -1
  24. data/data/parg/idf.json +1 -1
  25. data/data/parg/iec.json +1 -1
  26. data/data/parg/ieee.json +1 -1
  27. data/data/parg/iho.json +1 -0
  28. data/data/parg/ire.json +1 -1
  29. data/data/parg/ire.parg +51 -12
  30. data/data/parg/isbn.json +1 -1
  31. data/data/parg/iso.json +1 -1
  32. data/data/parg/iso.parg +751 -0
  33. data/data/parg/itu.json +1 -1
  34. data/data/parg/jcgm.json +1 -1
  35. data/data/parg/jis.json +1 -1
  36. data/data/parg/nesc.json +1 -1
  37. data/data/parg/nesc.parg +97 -12
  38. data/data/parg/nist.json +1 -1
  39. data/data/parg/oiml.json +1 -1
  40. data/data/parg/omg.json +1 -1
  41. data/data/parg/parg.json +1 -1
  42. data/data/parg/plateau.json +1 -1
  43. data/data/parg/tgpp.json +1 -1
  44. data/data/parg/un.json +1 -1
  45. data/lib/pubid/adobe/identifier.rb +1 -1
  46. data/lib/pubid/adobe/parser.rb +2 -113
  47. data/lib/pubid/amca/identifiers/base.rb +1 -1
  48. data/lib/pubid/amca/parser.rb +1 -145
  49. data/lib/pubid/ansi/identifier.rb +1 -1
  50. data/lib/pubid/ansi/parser.rb +1 -82
  51. data/lib/pubid/api/builder.rb +32 -1
  52. data/lib/pubid/api/identifier.rb +1 -1
  53. data/lib/pubid/api/parser.rb +1 -131
  54. data/lib/pubid/ashrae/identifiers/base.rb +1 -1
  55. data/lib/pubid/ashrae/parser.rb +3 -710
  56. data/lib/pubid/asme/builder.rb +6 -4
  57. data/lib/pubid/asme/identifier.rb +1 -2
  58. data/lib/pubid/asme/parser.rb +1 -328
  59. data/lib/pubid/astm/builder.rb +12 -3
  60. data/lib/pubid/astm/identifier.rb +1 -2
  61. data/lib/pubid/astm/parser.rb +1 -227
  62. data/lib/pubid/bipm/identifier.rb +8 -1
  63. data/lib/pubid/bipm/parser.rb +2 -224
  64. data/lib/pubid/bsi/builder.rb +2 -4
  65. data/lib/pubid/bsi/parser.rb +1 -666
  66. data/lib/pubid/bsi/single_identifier.rb +38 -1
  67. data/lib/pubid/calconnect/parser.rb +2 -40
  68. data/lib/pubid/ccsds/identifier.rb +1 -1
  69. data/lib/pubid/ccsds/parser.rb +1 -66
  70. data/lib/pubid/cen_cenelec/identifier.rb +16 -1
  71. data/lib/pubid/cen_cenelec/parser.rb +3 -136
  72. data/lib/pubid/cie/identifier.rb +1 -1
  73. data/lib/pubid/cie/parser.rb +3 -378
  74. data/lib/pubid/conformance.rb +1 -1
  75. data/lib/pubid/csa/builder.rb +41 -18
  76. data/lib/pubid/csa/identifier.rb +12 -4
  77. data/lib/pubid/csa/identifiers/amendment.rb +28 -0
  78. data/lib/pubid/csa/identifiers.rb +1 -0
  79. data/lib/pubid/csa/parser.rb +16 -397
  80. data/lib/pubid/doi/parser.rb +2 -37
  81. data/lib/pubid/easc/builder.rb +1 -1
  82. data/lib/pubid/easc/parser.rb +2 -70
  83. data/lib/pubid/ecma/CLAUDE.md +8 -1
  84. data/lib/pubid/ecma/identifier.rb +13 -8
  85. data/lib/pubid/ecma/parser.rb +2 -54
  86. data/lib/pubid/ecma/renderer.rb +3 -7
  87. data/lib/pubid/errors.rb +18 -13
  88. data/lib/pubid/etsi/builder.rb +8 -5
  89. data/lib/pubid/etsi/identifiers/base.rb +1 -1
  90. data/lib/pubid/etsi/parser.rb +1 -132
  91. data/lib/pubid/evs/identifier.rb +7 -0
  92. data/lib/pubid/evs/parser.rb +1 -8
  93. data/lib/pubid/evs.rb +1 -1
  94. data/lib/pubid/gb/identifier.rb +6 -0
  95. data/lib/pubid/gb/parser.rb +2 -51
  96. data/lib/pubid/gost/identifier.rb +9 -1
  97. data/lib/pubid/gost/parser.rb +4 -81
  98. data/lib/pubid/iala/builder.rb +48 -39
  99. data/lib/pubid/iala/identifier.rb +1 -1
  100. data/lib/pubid/iala/parser.rb +2 -121
  101. data/lib/pubid/iana/identifier.rb +1 -1
  102. data/lib/pubid/iana/parser.rb +2 -24
  103. data/lib/pubid/identifier.rb +78 -1
  104. data/lib/pubid/idf/builder.rb +42 -0
  105. data/lib/pubid/idf/identifier.rb +1 -1
  106. data/lib/pubid/idf/parser.rb +1 -137
  107. data/lib/pubid/idf.rb +1 -2
  108. data/lib/pubid/iec/builder.rb +158 -50
  109. data/lib/pubid/iec/identifier.rb +1 -1
  110. data/lib/pubid/iec/parser.rb +3 -430
  111. data/lib/pubid/ieee/CLAUDE.md +2 -0
  112. data/lib/pubid/ieee/aiee/identifier.rb +2 -1
  113. data/lib/pubid/ieee/aiee.rb +0 -1
  114. data/lib/pubid/ieee/builder.rb +177 -30
  115. data/lib/pubid/ieee/components/code.rb +46 -7
  116. data/lib/pubid/ieee/identifiers/base.rb +5 -2
  117. data/lib/pubid/ieee/identifiers/joint_development.rb +7 -3
  118. data/lib/pubid/ieee/ire/identifier.rb +2 -1
  119. data/lib/pubid/ieee/ire.rb +0 -1
  120. data/lib/pubid/ieee/nesc/builder.rb +1 -1
  121. data/lib/pubid/ieee/nesc.rb +0 -1
  122. data/lib/pubid/ieee/parser.rb +1 -1257
  123. data/lib/pubid/ieee/project_renderer.rb +5 -1
  124. data/lib/pubid/ieee/renderer.rb +4 -2
  125. data/lib/pubid/ieee/urn_generator.rb +4 -1
  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 +98 -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 +14 -1
  134. data/lib/pubid/iho/urn_parser.rb +45 -32
  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/CLAUDE.md +66 -0
  139. data/lib/pubid/iso/builder.rb +229 -15
  140. data/lib/pubid/iso/identifier.rb +22 -12
  141. data/lib/pubid/iso/identifiers/directives.rb +6 -3
  142. data/lib/pubid/iso/identifiers/guide.rb +6 -3
  143. data/lib/pubid/iso/identifiers/international_workshop_agreement.rb +6 -3
  144. data/lib/pubid/iso/normalizer.rb +5 -4
  145. data/lib/pubid/iso/parser.rb +1 -539
  146. data/lib/pubid/iso/supplement_identifier.rb +6 -3
  147. data/lib/pubid/iso/urn_parser.rb +13 -8
  148. data/lib/pubid/iso/utilities.rb +4 -5
  149. data/lib/pubid/iso.rb +1 -19
  150. data/lib/pubid/itu/builder.rb +36 -20
  151. data/lib/pubid/itu/identifiers/base.rb +15 -2
  152. data/lib/pubid/itu/parser.rb +1 -775
  153. data/lib/pubid/jcgm/builder.rb +35 -0
  154. data/lib/pubid/jcgm/parser.rb +1 -151
  155. data/lib/pubid/jcgm.rb +1 -2
  156. data/lib/pubid/jis/CLAUDE.md +36 -0
  157. data/lib/pubid/jis/builder.rb +30 -41
  158. data/lib/pubid/jis/identifier.rb +12 -2
  159. data/lib/pubid/jis/identifiers/welding_engineering_standard.rb +35 -0
  160. data/lib/pubid/jis/identifiers.rb +2 -0
  161. data/lib/pubid/jis/parser.rb +1 -128
  162. data/lib/pubid/jis/renderer.rb +1 -1
  163. data/lib/pubid/jis/supplement_identifier.rb +5 -5
  164. data/lib/pubid/jis/urn_parser.rb +2 -1
  165. data/lib/pubid/jis.rb +3 -2
  166. data/lib/pubid/nist/builder.rb +5 -1
  167. data/lib/pubid/nist/caster.rb +13 -3
  168. data/lib/pubid/nist/identifiers/base.rb +37 -2
  169. data/lib/pubid/nist/identifiers/circular.rb +2 -2
  170. data/lib/pubid/nist/identifiers/circular_supplement.rb +2 -2
  171. data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +2 -2
  172. data/lib/pubid/nist/identifiers/crpl_report.rb +2 -2
  173. data/lib/pubid/nist/identifiers/handbook.rb +2 -2
  174. data/lib/pubid/nist/identifiers/internal_report.rb +2 -2
  175. data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +2 -2
  176. data/lib/pubid/nist/identifiers/monograph.rb +2 -2
  177. data/lib/pubid/nist/identifiers/report.rb +2 -2
  178. data/lib/pubid/nist/parser.rb +19 -775
  179. data/lib/pubid/nist/router.rb +4 -1
  180. data/lib/pubid/nist/supplement_identifier.rb +2 -2
  181. data/lib/pubid/oasis/parser.rb +2 -16
  182. data/lib/pubid/ogc/parser.rb +2 -26
  183. data/lib/pubid/oiml/identifiers/certification_system.rb +7 -0
  184. data/lib/pubid/oiml/identifiers/dual_published.rb +2 -2
  185. data/lib/pubid/oiml/parser.rb +1 -303
  186. data/lib/pubid/oiml.rb +1 -2
  187. data/lib/pubid/omg/identifier.rb +6 -1
  188. data/lib/pubid/omg/parser.rb +2 -76
  189. data/lib/pubid/parser.rb +5 -4
  190. data/lib/pubid/parsers/mr_string.rb +1 -1
  191. data/lib/pubid/plateau/parser.rb +1 -66
  192. data/lib/pubid/plateau.rb +1 -2
  193. data/lib/pubid/renderers/directives_renderer.rb +1 -1
  194. data/lib/pubid/renderers/iwa_renderer.rb +1 -1
  195. data/lib/pubid/renderers/publisher_stripper.rb +82 -0
  196. data/lib/pubid/renderers/supplement_renderer.rb +1 -1
  197. data/lib/pubid/renderers.rb +1 -0
  198. data/lib/pubid/sae/parser.rb +1 -48
  199. data/lib/pubid/tgpp/identifier.rb +1 -1
  200. data/lib/pubid/tgpp/parser.rb +2 -59
  201. data/lib/pubid/un/identifier.rb +1 -1
  202. data/lib/pubid/un/parser.rb +1 -18
  203. data/lib/pubid/version.rb +1 -1
  204. data/lib/pubid/w3c/parser.rb +2 -27
  205. data/lib/pubid/xsf/identifier.rb +10 -6
  206. data/lib/pubid/xsf/parser.rb +3 -31
  207. data/lib/pubid/xsf/renderer.rb +2 -4
  208. data/lib/pubid.rb +8 -9
  209. metadata +9 -23
  210. data/lib/pubid/ieee/aiee/parser.rb +0 -130
  211. data/lib/pubid/ieee/ire/parser.rb +0 -109
  212. data/lib/pubid/ieee/nesc/parser.rb +0 -155
  213. data/lib/pubid/iho/parser.rb +0 -68
  214. data/lib/pubid/parser/common_parse_methods.rb +0 -13
  215. data/lib/pubid/parser/common_parse_rules.rb +0 -56
  216. data/lib/pubid/parser/grammar.rb +0 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae2acfef37e6d1fd8e4ec7cd7af75b4284f614c9ed8842a8efd678fcc9908fea
4
- data.tar.gz: '08bea748448b480b7f3032301ce3c56444a11b8399a55712ed8ba7690432c07b'
3
+ metadata.gz: 88bef3bd9d8e7bd7ef466bf6bc0d6ddf5d3a52d00778f98644b3530ff401f3c2
4
+ data.tar.gz: 500430f50d0f0c52449d1f0ea4d6c28bf690257c5c240d23aceedf7b8c9fcb41
5
5
  SHA512:
6
- metadata.gz: f498d11014bba5f72cb6bd28e09a46ac3f6f64a159f4a8c2de57d1101db3e4d29770c6ee5798b8e3cf99510a9470872b022d06f480f6fa4293c5aa387a3112ee
7
- data.tar.gz: 462b9d360a60a31007bd4d1b892c67ae9d8879cf9f868750d297c04c35993c8151a4a2e3baa68aae32493d62bf699777ac97237c9a87c95f98e85efd7e7fe9d6
6
+ metadata.gz: 6e24987d7bbdf5477fcc064b4fbfc04c7f754aac4134ce417baeeacff785ec261d07ae482350b1c2f4d8ac21d4768bd56921bafa5860a85b681e08fffabbebc2
7
+ data.tar.gz: 9a6e85627162ed1e86e749d6a05529eb83948e70ad7e467db29abf1339be597175958f61d0630b7a8f40b6fbc4e95e31c86d0cab11dcf10288d7f714ba32a25e
@@ -150,7 +150,7 @@ ISO/IEC/IEEE CD P26513/D1, August 2015: ISO/IEC/IEEE P26513/D1, August 2015
150
150
  # reposition target: the grammar reads "/013.0" (leading-zero draft
151
151
  # ordinal) and draft_date's " October 2017" natively - the rewrite
152
152
  # below ate the month.
153
- "IEC/IEEE P62271-37-013:2015 D13.4": "IEC/IEEE P62271.37-013/D-13.4-2015"
153
+ "IEC/IEEE P62271-37-013:2015 D13.4": "IEC/IEEE P62271.37.013/D-13.4-2015"
154
154
  "ISO/IEC/IEEE DIS P42020:201x(E), June 2017": "ISO/IEC/IEEE DIS P42020-2017-06"
155
155
  "ISO/IEC/IEEE DIS P16326/201x, December 2018": "ISO/IEC/IEEE DIS P16326-2018-12"
156
156
  "ISO/IEC/IEEE/P21839, 2019(E)": "ISO/IEC/IEEE P21839-2019"
@@ -167,7 +167,7 @@ ISO/IEC/IEEE CD P26513/D1, August 2015: ISO/IEC/IEEE P26513/D1, August 2015
167
167
  "ISO/IEC13210: 1994 (E) ANSI/IEEE Std 1003.3-1991": "ISO/IEC 13210:1994 (E); ANSI/IEEE Std 1003.3-1991"
168
168
  "J-STD-016-1995": "IEEE 016-1995"
169
169
  "Nuclear EQ Sourcebook and Supplement": "IEEE 7438946"
170
- "PC37.30.2/D043 Rev 18, May 2015": "IEEE PC37.30-2/D-043/R-18-2015"
170
+ "PC37.30.2/D043 Rev 18, May 2015": "IEEE PC37.30.2/D-043/R-18-2015"
171
171
  "IEEE/IEC P62582 CD2 proposal, May 2017": "IEEE/IEC CD2 P62582-2017-05"
172
172
  "ISO/IEC/IEEE P16326:201x WD.4a, July 2017": "ISO/IEC/IEEE P16326:2017/D=WD.4a"
173
173
  "ISO/IEC/IEEE CD.1 P21839, October 2017": "ISO/IEC/IEEE CD1 P21839-2017-10"
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\" mode \"v1\" {\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":"b3d1aa146e66a4b8601a83798c6ef2175a6c18e2a1600ff42b325ed344f322b8","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":1,"checksum":"sha256:4c85d5c04fd92ea255e72659a3ddd00a3647d509eea3ffdbdb77910d1e97f95e"}
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\" 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"}
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}},{"Str":{"pattern":" "}},{"Entity":{"atom":21}},{"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":[9,10,11,12,13,14,15,16,17,18,19]}},{"Named":{"name":"type","atom":20}},{"Str":{"pattern":" "}},{"Sequence":{"atoms":[8,22]}},{"Repetition":{"atom":23,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":61}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":26,"min":2,"max":3,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":29,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[27,28,30]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":32,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Str":{"pattern":" and"}},{"Lookahead":{"atom":35,"positive":false}},{"Sequence":{"atoms":[33,34,36]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":38,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":41}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":42,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[39,40,43]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":45,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":" ("}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":48,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[46,47,49,50]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":52,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":" and "}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":55,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[54,56]}},{"Lookahead":{"atom":57,"positive":false}},{"Sequence":{"atoms":[53,58]}},{"Alternative":{"atoms":[31,37,44,51,59]}},{"Named":{"name":"number","atom":60}},{"Entity":{"atom":175}},{"Entity":{"atom":86}},{"Str":{"pattern":" "}},{"Repetition":{"atom":64,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"-"}},{"Str":{"pattern":"18"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":68,"min":2,"max":2,"tag":"Repetition"}},{"Sequence":{"atoms":[67,69]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"0"}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[72,73,74,75,76,77]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[71,78,79]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[81,82]}},{"Alternative":{"atoms":[70,80,83]}},{"Named":{"name":"year","atom":84}},{"Sequence":{"atoms":[65,66,85]}},{"Entity":{"atom":173}},{"Str":{"pattern":" "}},{"Repetition":{"atom":88,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":","}},{"Str":{"pattern":"."}},{"Alternative":{"atoms":[90,91]}},{"Named":{"name":"separator","atom":92}},{"Str":{"pattern":" "}},{"Repetition":{"atom":94,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":121}},{"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":[97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120]}},{"Named":{"name":"month","atom":96}},{"Str":{"pattern":" "}},{"Sequence":{"atoms":[122,123]}},{"Repetition":{"atom":124,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"18"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":127,"min":2,"max":2,"tag":"Repetition"}},{"Sequence":{"atoms":[126,128]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"0"}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[131,132,133,134,135,136]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[130,137,138]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[140,141]}},{"Alternative":{"atoms":[129,139,142]}},{"Named":{"name":"year","atom":143}},{"Sequence":{"atoms":[93,95,125,144]}},{"Sequence":{"atoms":[89,145]}},{"Str":{"pattern":" "}},{"Repetition":{"atom":147,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" -"}},{"Named":{"name":"separator","atom":149}},{"Str":{"pattern":" "}},{"Repetition":{"atom":151,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"18"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":154,"min":2,"max":2,"tag":"Repetition"}},{"Sequence":{"atoms":[153,155]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"0"}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[158,159,160,161,162,163]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[157,164,165]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[167,168]}},{"Alternative":{"atoms":[156,166,169]}},{"Named":{"name":"year","atom":170}},{"Sequence":{"atoms":[148,150,152,171]}},{"Alternative":{"atoms":[146,172]}},{"Alternative":{"atoms":[63,87]}},{"Repetition":{"atom":174,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,7,24,25,62]}}],"root":176},"bindings":[{"capture":"publisher","path":"publisher","type":"string","card":null,"preprocess":null},{"capture":"type","path":"type","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"separator","path":"separator","type":"string","card":null,"preprocess":null},{"capture":"month","path":"month","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null}]}},"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#\n# Edition-2 notes: the number capture inlines all five alternatives to\n# raw terms, including the parenthetical-alternate branch — its\n# main_number/alt_number/parenthetical sub-captures drop (a wrapper over\n# them expands to element hashes, which cannot bind scalar; the old\n# pipeline already flattened the subtree to the \"431 (105)\" span the\n# capture now binds directly). The year body inlines at every capture\n# site for the same reason; the digits rule inlines to 1*%x30-39 (a ref\n# whose body is a repetition expands to node lists inside a capture).\n\ngrammar PubidAiee version \"0.1.0\" edition 2 {\n digit = %x30-39\n upper = %x41-5A\n lower = %x61-7A\n digits = 1*%x30-39\n space = \" \"\n dash = \"-\"\n dot = \".\"\n\n year = ((\"18\" 2%x30-39)) / ((\"19\" (\"0\" / \"1\" / \"2\" / \"3\" / \"4\" / \"5\") %x30-39)) / ((\"196\" %x30-33))\n month_name = {\n \"September\"\n / \"November\"\n / \"December\"\n / \"February\"\n / \"August\"\n / \"June\"\n / \"January\"\n / \"March\"\n / \"April\"\n / \"October\"\n / \"July\"\n / \"May\"\n / \"Sept\"\n / \"Jan\"\n / \"Feb\"\n / \"Mar\"\n / \"Apr\"\n / \"Jun\"\n / \"Jul\"\n / \"Aug\"\n / \"Sep\"\n / \"Oct\"\n / \"Nov\"\n / \"Dec\"\n }\n aiee_prefix = (\"IEEE-AIEE\" / \"A.I.E.E.\" / \"A. I. E. E.\" / \"AIEE\") as publisher\n aiee_type = {\n (\n \"Standard No.\"\n / \"Standard No\"\n / \"Std No.\"\n / \"Std No\"\n / \"Std\"\n / \"Nos\"\n / \"No.\"\n / \"No\"\n / \"no\"\n / \"Standard\"\n / \"Trans.\"\n ) as type\n }\n number = {\n (\n ( 2*3%x41-5A \"-\" 1*%x30-39 )\n / ( 1*%x30-39 %x41-5A !( \" and\" ) )\n / ( 1*%x30-39 dot 1*%x30-39 )\n / ( 1*%x30-39 \" (\" 1*%x30-39 \")\" )\n / ( 1*%x30-39 !( \" and \" 1*%x30-39 ) )\n ) as number\n }\n # The source's third date_long alternative (month dash year, no\n # separator) is dropped deliberately: under the edition-1 branch-commit\n # semantics the leading [space] commits before the alternation, so the\n # month-first form never matches (\"AIEE No 15May-1928\" and\n # \"AIEE No 15 May-1928\" both reject on the edition-1 artifact). Keeping\n # it would widen the accept set; month forms ride the separator\n # alternative, as on edition 1.\n #\n # The year body inlines at every capture site (a capture wrapping the\n # year rule ref expands to element hashes; the inline alternation binds\n # as one scalar string).\n date_long = {\n (\n ( [\" \"] ( ( ( \",\" / \".\" ) as separator ) [\" \"] [ ( month_name ) as month \" \" ]\n ( (\"18\" 2%x30-39)\n / (\"19\" (\"0\" / \"1\" / \"2\" / \"3\" / \"4\" / \"5\") %x30-39)\n / (\"196\" %x30-33) ) as year ) )\n / ( [\" \"] ( \" -\" ) as separator [\" \"]\n ( (\"18\" 2%x30-39)\n / (\"19\" (\"0\" / \"1\" / \"2\" / \"3\" / \"4\" / \"5\") %x30-39)\n / (\"196\" %x30-33) ) as year )\n )\n }\n date_short = {\n [\" \"] \"-\"\n ( (\"18\" 2%x30-39) / (\"19\" (\"0\" / \"1\" / \"2\" / \"3\" / \"4\" / \"5\") %x30-39) / (\"196\" %x30-33) ) as year\n }\n date = [(date_short / date_long)]\n\n aiee_identifier = aiee_prefix \" \" [aiee_type \" \"] number date\n\n entry aiee_identifier: aiee_identifier\n\n bindings aiee_identifier {\n publisher -> publisher (string)\n type -> type (string)\n number -> number (string)\n separator -> separator (string)\n month -> month (string)\n year -> year (string)\n }\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":"41c7feee510cd38fb391ef4bd8e581dfc8edd5126d9660a8c7fbde8ac79bfe44","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":2,"checksum":"sha256:bcc38e0fc9229eef59567d1ccfec405752eede92a7737d4d2e1ebf5e247d5874"}
data/data/parg/aiee.parg CHANGED
@@ -4,29 +4,119 @@
4
4
  # parenthetical alternates) and long/short dates. Consumed by the ieee
5
5
  # grammar via `use aiee`. Deviation: source "Sep"/"Sept" order is
6
6
  # lint-forced to longest-first.
7
+ #
8
+ # Edition-2 notes: the number capture inlines all five alternatives to
9
+ # raw terms, including the parenthetical-alternate branch — its
10
+ # main_number/alt_number/parenthetical sub-captures drop (a wrapper over
11
+ # them expands to element hashes, which cannot bind scalar; the old
12
+ # pipeline already flattened the subtree to the "431 (105)" span the
13
+ # capture now binds directly). The year body inlines at every capture
14
+ # site for the same reason; the digits rule inlines to 1*%x30-39 (a ref
15
+ # whose body is a repetition expands to node lists inside a capture).
7
16
 
8
- grammar PubidAiee version "0.1.0" {
17
+ grammar PubidAiee version "0.1.0" edition 2 {
9
18
  digit = %x30-39
10
19
  upper = %x41-5A
11
20
  lower = %x61-7A
12
- digits = 1*digit
21
+ digits = 1*%x30-39
13
22
  space = " "
14
23
  dash = "-"
15
24
  dot = "."
16
25
 
17
- year = (("18" 2digit)) / (("19" ("0" / "1" / "2" / "3" / "4" / "5") digit)) / (("196" %x30-33))
18
- 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"
26
+ year = (("18" 2%x30-39)) / (("19" ("0" / "1" / "2" / "3" / "4" / "5") %x30-39)) / (("196" %x30-33))
27
+ month_name = {
28
+ "September"
29
+ / "November"
30
+ / "December"
31
+ / "February"
32
+ / "August"
33
+ / "June"
34
+ / "January"
35
+ / "March"
36
+ / "April"
37
+ / "October"
38
+ / "July"
39
+ / "May"
40
+ / "Sept"
41
+ / "Jan"
42
+ / "Feb"
43
+ / "Mar"
44
+ / "Apr"
45
+ / "Jun"
46
+ / "Jul"
47
+ / "Aug"
48
+ / "Sep"
49
+ / "Oct"
50
+ / "Nov"
51
+ / "Dec"
52
+ }
19
53
  aiee_prefix = ("IEEE-AIEE" / "A.I.E.E." / "A. I. E. E." / "AIEE") as publisher
20
- aiee_type = ("Standard No." / "Standard No" / "Std No." / "Std No" / "Std" / "Nos" / "No." / "No" / "no" / "Standard" / "Trans.") as type
21
- 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
22
- 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)))
23
- date_short = ([space] dash (year) as year)
54
+ aiee_type = {
55
+ (
56
+ "Standard No."
57
+ / "Standard No"
58
+ / "Std No."
59
+ / "Std No"
60
+ / "Std"
61
+ / "Nos"
62
+ / "No."
63
+ / "No"
64
+ / "no"
65
+ / "Standard"
66
+ / "Trans."
67
+ ) as type
68
+ }
69
+ number = {
70
+ (
71
+ ( 2*3%x41-5A "-" 1*%x30-39 )
72
+ / ( 1*%x30-39 %x41-5A !( " and" ) )
73
+ / ( 1*%x30-39 dot 1*%x30-39 )
74
+ / ( 1*%x30-39 " (" 1*%x30-39 ")" )
75
+ / ( 1*%x30-39 !( " and " 1*%x30-39 ) )
76
+ ) as number
77
+ }
78
+ # The source's third date_long alternative (month dash year, no
79
+ # separator) is dropped deliberately: under the edition-1 branch-commit
80
+ # semantics the leading [space] commits before the alternation, so the
81
+ # month-first form never matches ("AIEE No 15May-1928" and
82
+ # "AIEE No 15 May-1928" both reject on the edition-1 artifact). Keeping
83
+ # it would widen the accept set; month forms ride the separator
84
+ # alternative, as on edition 1.
85
+ #
86
+ # The year body inlines at every capture site (a capture wrapping the
87
+ # year rule ref expands to element hashes; the inline alternation binds
88
+ # as one scalar string).
89
+ date_long = {
90
+ (
91
+ ( [" "] ( ( ( "," / "." ) as separator ) [" "] [ ( month_name ) as month " " ]
92
+ ( ("18" 2%x30-39)
93
+ / ("19" ("0" / "1" / "2" / "3" / "4" / "5") %x30-39)
94
+ / ("196" %x30-33) ) as year ) )
95
+ / ( [" "] ( " -" ) as separator [" "]
96
+ ( ("18" 2%x30-39)
97
+ / ("19" ("0" / "1" / "2" / "3" / "4" / "5") %x30-39)
98
+ / ("196" %x30-33) ) as year )
99
+ )
100
+ }
101
+ date_short = {
102
+ [" "] "-"
103
+ ( ("18" 2%x30-39) / ("19" ("0" / "1" / "2" / "3" / "4" / "5") %x30-39) / ("196" %x30-33) ) as year
104
+ }
24
105
  date = [(date_short / date_long)]
25
106
 
26
- aiee_identifier = aiee_prefix space [(aiee_type space)] number date
107
+ aiee_identifier = aiee_prefix " " [aiee_type " "] number date
27
108
 
28
109
  entry aiee_identifier: aiee_identifier
29
110
 
111
+ bindings aiee_identifier {
112
+ publisher -> publisher (string)
113
+ type -> type (string)
114
+ number -> number (string)
115
+ separator -> separator (string)
116
+ month -> month (string)
117
+ year -> year (string)
118
+ }
119
+
30
120
  test {
31
121
  accept "AIEE No. 56"
32
122
  accept "AIEE Std 800"
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\" mode \"v1\" {\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":"98695c3d7a204586cee5c51171c50d10e485ec910e65ac01411fa5a84c948691","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":1,"checksum":"sha256:4641e8f9d124ab81cefb65b200d65bdb669b0d4a6747f38ed1d2ae519af9b9da"}
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\" mode \"v1\" {\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":"3e9a02761f82073142f1ef9b93c5552027e2e857de3200b4edf8e34db23f2d54","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":1,"checksum":"sha256:8148989ba1e7af01f03ee91c8568018be64744ac6e3986b4e0e2d38688cb6b86"}
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\" mode \"v1\" {\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":"8012576560740a9ef17526c5dec112891196af228cf2cf346913e495607b4315","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":1,"checksum":"sha256:f3dfdc867c9705bb7cfbb8735487c856b7fe568a2af7b409103ea98f79c9bf6a"}
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"}