pubid 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/ieee/update_codes.yaml +2 -2
- data/data/parg/aiee.json +1 -1
- data/data/parg/aiee.parg +99 -9
- data/data/parg/iala.json +1 -1
- data/data/parg/ieee.json +1 -1
- data/data/parg/ire.json +1 -1
- data/data/parg/ire.parg +51 -12
- data/data/parg/iso.json +1 -1
- data/data/parg/iso.parg +751 -0
- data/data/parg/jis.json +1 -1
- data/data/parg/nesc.json +1 -1
- data/data/parg/nesc.parg +97 -12
- data/data/parg/parg.json +1 -1
- data/lib/pubid/iala/builder.rb +48 -39
- data/lib/pubid/iala/identifier.rb +1 -1
- data/lib/pubid/ieee/CLAUDE.md +2 -0
- data/lib/pubid/ieee/aiee/identifier.rb +1 -1
- data/lib/pubid/ieee/builder.rb +175 -28
- data/lib/pubid/ieee/components/code.rb +46 -7
- data/lib/pubid/ieee/identifiers/base.rb +4 -1
- data/lib/pubid/ieee/identifiers/joint_development.rb +7 -3
- data/lib/pubid/ieee/ire/identifier.rb +1 -1
- data/lib/pubid/ieee/nesc/builder.rb +1 -1
- data/lib/pubid/ieee/project_renderer.rb +5 -1
- data/lib/pubid/ieee/renderer.rb +4 -2
- data/lib/pubid/ieee/urn_generator.rb +4 -1
- data/lib/pubid/iho/CLAUDE.md +15 -6
- data/lib/pubid/iho/urn_generator.rb +9 -6
- data/lib/pubid/iho/urn_parser.rb +43 -40
- data/lib/pubid/iso/CLAUDE.md +66 -0
- data/lib/pubid/iso/builder.rb +228 -14
- data/lib/pubid/iso/identifier.rb +22 -12
- data/lib/pubid/iso/normalizer.rb +5 -4
- data/lib/pubid/iso/urn_parser.rb +13 -8
- data/lib/pubid/jis/CLAUDE.md +36 -0
- data/lib/pubid/jis/builder.rb +12 -12
- data/lib/pubid/jis/identifier.rb +11 -1
- data/lib/pubid/jis/identifiers/welding_engineering_standard.rb +35 -0
- data/lib/pubid/jis/identifiers.rb +2 -0
- data/lib/pubid/jis/renderer.rb +1 -1
- data/lib/pubid/jis/supplement_identifier.rb +5 -5
- data/lib/pubid/jis/urn_parser.rb +2 -1
- data/lib/pubid/jis.rb +3 -2
- data/lib/pubid/version.rb +1 -1
- metadata +9 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84bd43c2b2468d0b30852e4d2d624a031d285deafe17e8e82d1dfa7c9d1b9b69
|
|
4
|
+
data.tar.gz: 1b38d8c8f8fa201e5af2a029ccd6ca64b99cd9b942211cf8d4819002e2ef220b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 01feda9bcfedabf22e2e759b19962b3defdc2c89149d3e25549520aac507d47e7ff1ae51662aa6c5126abb6a7d15e8a3859012383c6e6470251d34c2ca127d0f
|
|
7
|
+
data.tar.gz: 87106f99d5450648e77694567752fa6aa48918ce6d88544393c3baa04ccd5a71e46ba7eae25f76a0ce692db59c7d8095dc62c1a783dbc23de8ae59231822eb3b
|
data/data/ieee/update_codes.yaml
CHANGED
|
@@ -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
|
|
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
|
|
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/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
|
|
21
|
+
digits = 1*%x30-39
|
|
13
22
|
space = " "
|
|
14
23
|
dash = "-"
|
|
15
24
|
dot = "."
|
|
16
25
|
|
|
17
|
-
year = (("18"
|
|
18
|
-
month_name =
|
|
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 =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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/iala.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidIala","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":100}},{"Entity":{"atom":3}},{"Str":{"pattern":"IALA "}},{"Repetition":{"atom":2,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Str":{"pattern":"GA"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"X"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[5,6,7,8,9,10,11,12,13,14]}},{"Named":{"name":"type_letter","atom":15}},{"Entity":{"atom":30}},{"Entity":{"atom":22}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":19,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number","atom":21}},{"Entity":{"atom":27}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Repetition":{"atom":25,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[24,26]}},{"Repetition":{"atom":23,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number_dots","atom":28}},{"Sequence":{"atoms":[18,29]}},{"Entity":{"atom":39}},{"Entity":{"atom":33}},{"Str":{"pattern":"-"}},{"Entity":{"atom":20}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart_number","atom":35}},{"Sequence":{"atoms":[32,36]}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart","atom":38}},{"Repetition":{"atom":31,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,17,40]}},{"Named":{"name":"base","atom":41}},{"Entity":{"atom":44}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[45,46]}},{"Named":{"name":"annex_marker","atom":47}},{"Entity":{"atom":44}},{"Entity":{"atom":51}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Named":{"name":"annex_letter","atom":50}},{"Entity":{"atom":54}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Lookahead":{"atom":53,"positive":false}},{"Sequence":{"atoms":[49,52,55]}},{"Repetition":{"atom":56,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":74}},{"Entity":{"atom":44}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":44}},{"Entity":{"atom":72}},{"Entity":{"atom":20}},{"Repetition":{"atom":63,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":66}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Repetition":{"atom":67,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[65,68]}},{"Repetition":{"atom":69,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[64,70]}},{"Named":{"name":"edition_value","atom":71}},{"Sequence":{"atoms":[59,60,61,62]}},{"Named":{"name":"edition","atom":73}},{"Entity":{"atom":81}},{"Entity":{"atom":77}},{"Str":{"pattern":":"}},{"Str":{"pattern":"ed"}},{"Entity":{"atom":72}},{"Sequence":{"atoms":[76,78,79]}},{"Named":{"name":"edition","atom":80}},{"Alternative":{"atoms":[58,75]}},{"Repetition":{"atom":82,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":98}},{"Entity":{"atom":44}},{"Repetition":{"atom":85,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"R"}},{"Alternative":{"atoms":[88,89,90,91,92,93]}},{"Named":{"name":"language","atom":94}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[86,87,95,96]}},{"Named":{"name":"language_group","atom":97}},{"Repetition":{"atom":84,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[42,43,48,57,83,99]}},{"Entity":{"atom":3}},{"Entity":{"atom":107}},{"Entity":{"atom":16}},{"Entity":{"atom":30}},{"Entity":{"atom":39}},{"Repetition":{"atom":105,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[103,104,106]}},{"Entity":{"atom":74}},{"Entity":{"atom":81}},{"Alternative":{"atoms":[108,109]}},{"Repetition":{"atom":110,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":98}},{"Repetition":{"atom":112,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[101,102,111,113]}},{"Alternative":{"atoms":[0,114]}}],"root":115},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"G1040","expect":{}},{"entry":"identifier","kind":"accept","input":"GA1040","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/iala/parser.rb: [IALA ]<type><number>[.dots][-subs]\n# [ Ed X.Y | :edX.Y] [(L)], plus the Annex-to-base form. The annex\n# letter guard (!lower) keeps \"Ed 1\" from mis-capturing.\n\ngrammar PubidIala version \"0.1.0\" mode \"v1\" {\n type_letter = (\"GA\" / \"S\" / \"R\" / \"G\" / \"M\" / \"C\" / \"A\" / \"L\" / \"X\" / \"P\") as type_letter\n doc_number = (1*digit) as doc_number\n dotted_number = \".\" 1*digit\n number_with_dots = doc_number (*dotted_number) as doc_number_dots\n subpart = (1*(dash (1*digit) as subpart_number)) as subpart\n code = type_letter number_with_dots [subpart]\n edition_value = (1*digit *(dot 1*digit)) as edition_value\n edition_human = (space \"Ed\" space edition_value) as edition\n edition_compact = (colon \"ed\" edition_value) as edition\n language_group = ([space] \"(\" (\"E\" / \"F\" / \"S\" / \"C\" / \"A\" / \"R\") as language \")\") as language_group\n annex_identifier = ((publisher type_letter number_with_dots [subpart]) as base) space (\"Annex\" / \"ANNEX\") as annex_marker [(space upper as annex_letter !lower)] [edition_human / edition_compact] [language_group]\n identifier = annex_identifier / (publisher code [edition_human / edition_compact] [language_group])\n publisher = [\"IALA \"]\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dash = \"-\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n test {\n accept \"G1040\"\n accept \"GA1040\"\n reject \"nonsense\"\n }\n}\n","source_hash":"25acb18664a7331ec4ad98482f8c10eab6bb354789120a62fc5ea6a2fa4eda6f","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":1,"checksum":"sha256:28e50082a43b523c794edec7f6266f797bbc48ce1440d753f9f02e33716a224a"}
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidIala","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":104}},{"Entity":{"atom":3}},{"Str":{"pattern":"IALA "}},{"Repetition":{"atom":2,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Str":{"pattern":"GA"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"X"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[5,6,7,8,9,10,11,12,13,14]}},{"Named":{"name":"type_letter","atom":15}},{"Entity":{"atom":33}},{"Entity":{"atom":22}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":19,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number","atom":21}},{"Entity":{"atom":30}},{"Entity":{"atom":25}},{"Str":{"pattern":"."}},{"Named":{"name":"dot","atom":24}},{"Entity":{"atom":20}},{"Repetition":{"atom":27,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"dotted_segment","atom":28}},{"Sequence":{"atoms":[26,29]}},{"Repetition":{"atom":23,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number_dots","atom":31}},{"Sequence":{"atoms":[18,32]}},{"Entity":{"atom":44}},{"Entity":{"atom":42}},{"Entity":{"atom":37}},{"Str":{"pattern":"-"}},{"Named":{"name":"dash","atom":36}},{"Entity":{"atom":20}},{"Repetition":{"atom":39,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart_number","atom":40}},{"Sequence":{"atoms":[38,41]}},{"Repetition":{"atom":35,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart","atom":43}},{"Repetition":{"atom":34,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,17,45]}},{"Named":{"name":"base","atom":46}},{"Entity":{"atom":49}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[50,51]}},{"Named":{"name":"annex_marker","atom":52}},{"Entity":{"atom":49}},{"Entity":{"atom":56}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Named":{"name":"annex_letter","atom":55}},{"Entity":{"atom":59}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Lookahead":{"atom":58,"positive":false}},{"Sequence":{"atoms":[54,57,60]}},{"Repetition":{"atom":61,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":78}},{"Entity":{"atom":49}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":49}},{"Entity":{"atom":76}},{"Entity":{"atom":20}},{"Repetition":{"atom":68,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":25}},{"Entity":{"atom":20}},{"Repetition":{"atom":71,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[70,72]}},{"Repetition":{"atom":73,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[69,74]}},{"Named":{"name":"edition_value","atom":75}},{"Sequence":{"atoms":[64,65,66,67]}},{"Named":{"name":"edition","atom":77}},{"Entity":{"atom":85}},{"Entity":{"atom":81}},{"Str":{"pattern":":"}},{"Str":{"pattern":"ed"}},{"Entity":{"atom":76}},{"Sequence":{"atoms":[80,82,83]}},{"Named":{"name":"edition","atom":84}},{"Alternative":{"atoms":[63,79]}},{"Repetition":{"atom":86,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":102}},{"Entity":{"atom":49}},{"Repetition":{"atom":89,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"R"}},{"Alternative":{"atoms":[92,93,94,95,96,97]}},{"Named":{"name":"language","atom":98}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[90,91,99,100]}},{"Named":{"name":"language_group","atom":101}},{"Repetition":{"atom":88,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[47,48,53,62,87,103]}},{"Entity":{"atom":120}},{"Entity":{"atom":3}},{"Named":{"name":"publisher","atom":106}},{"Entity":{"atom":113}},{"Entity":{"atom":16}},{"Entity":{"atom":33}},{"Entity":{"atom":44}},{"Repetition":{"atom":111,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[109,110,112]}},{"Entity":{"atom":78}},{"Entity":{"atom":85}},{"Alternative":{"atoms":[114,115]}},{"Repetition":{"atom":116,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":102}},{"Repetition":{"atom":118,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[107,108,117,119]}},{"Alternative":{"atoms":[0,105]}}],"root":121},"bindings":[{"capture":"type_letter","path":"type_letter","type":"string","card":null,"preprocess":null},{"capture":"doc_number","path":"doc_number","type":"string","card":null,"preprocess":null},{"capture":"dotted_segment","path":"doc_number_dots[].dotted_segment","type":"string","card":null,"preprocess":null},{"capture":"subpart_number","path":"subpart[].subpart_number","type":"string","card":null,"preprocess":null},{"capture":"edition_value","path":"edition_value","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"annex_marker","path":"annex_marker","type":"string","card":null,"preprocess":null},{"capture":"annex_letter","path":"annex_letter","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"G1040","expect":{}},{"entry":"identifier","kind":"accept","input":"GA1040","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"accept","input":"R1016:ed2.0(F)","expect":{}},{"entry":"identifier","kind":"accept","input":"C0103-1 Ed 3.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA L2.1.11 Ed 2","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1128 Annex A Ed 1.6","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1045 Annex Ed 1","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA A12-01 (E)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"example","input":"G1040","expect":{"type_letter":"G","doc_number":"1040"}},{"entry":"identifier","kind":"example","input":"GA01.01","expect":{"type_letter":"GA","doc_number":"01","doc_number_dots":[{"dotted_segment":"01"}]}},{"entry":"identifier","kind":"example","input":"C0103-1","expect":{"type_letter":"C","doc_number":"0103","subpart":[{"subpart_number":"1"}]}},{"entry":"identifier","kind":"example","input":"IALA S1070 Ed 2.0","expect":{"type_letter":"S","doc_number":"1070","edition_value":"2.0"}},{"entry":"identifier","kind":"example","input":"IALA G1128 Annex A Ed 1.6","expect":{"type_letter":"G","doc_number":"1128","annex_marker":"Annex","annex_letter":"A","edition_value":"1.6"}}],"docs":{},"source":"# Port of lib/pubid/iala/parser.rb: [IALA ]<type><number>[.dots][-subs]\n# [ Ed X.Y | :edX.Y] [(L)], plus the Annex-to-base form. The annex\n# letter guard (!lower) keeps \"Ed 1\" from mis-capturing.\n#\n# Edition-2 conversion with typed model bindings. Deviations from the\n# v1 tree:\n# - the dotted continuation and the dash subpart repeat capture-bearing\n# rule refs (the itu `parts` shape): a repetition over a capture-less\n# unit harvested as a bare span binds differently per engine, so the\n# bindings read the inner captures through the array paths\n# `doc_number_dots[].dotted_segment` and `subpart[].subpart_number`.\n# The dotted segment gains its own capture (`dotted_segment`); the\n# subpart keeps its `subpart_number` capture, hoisted out of the\n# inline repetition into a rule ref of its own.\n# - the annex base composite stays unbound. Every capture inside it\n# (type_letter, doc_number, …) is the only occurrence of its name on\n# the annex path, so the binding harvest hoists it to the top level:\n# the builder reads one flat map for the plain and the annex form\n# alike and dispatches on :annex_marker. edition_value and language\n# hoist out of their edition/language_group composites the same way.\n\ngrammar PubidIala version \"0.1.0\" edition 2 {\n type_letter = (\"GA\" / \"S\" / \"R\" / \"G\" / \"M\" / \"C\" / \"A\" / \"L\" / \"X\" / \"P\") as type_letter\n doc_number = (1*digit) as doc_number\n dotted_number = dot (1*digit) as dotted_segment\n number_with_dots = doc_number (*dotted_number) as doc_number_dots\n subpart_number = dash (1*digit) as subpart_number\n subpart = (1*subpart_number) as subpart\n code = type_letter number_with_dots [subpart]\n edition_value = (1*digit *(dot 1*digit)) as edition_value\n edition_human = (space \"Ed\" space edition_value) as edition\n edition_compact = (colon \"ed\" edition_value) as edition\n language_group = ([space] \"(\" (\"E\" / \"F\" / \"S\" / \"C\" / \"A\" / \"R\") as language \")\") as language_group\n annex_identifier = {\n ((publisher type_letter number_with_dots [subpart]) as base)\n space\n (\"Annex\" / \"ANNEX\") as annex_marker\n [ (space upper as annex_letter !lower) ]\n [edition_human / edition_compact]\n [language_group]\n }\n plain_identifier = {\n publisher code [edition_human / edition_compact] [language_group]\n }\n identifier = {\n annex_identifier\n / plain_identifier\n }\n publisher = [\"IALA \"]\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dash = \"-\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n type_letter -> type_letter (string)\n doc_number -> doc_number (string)\n dotted_segment -> doc_number_dots[].dotted_segment (string)\n subpart_number -> subpart[].subpart_number (string)\n edition_value -> edition_value (string)\n language -> language (string)\n annex_marker -> annex_marker (string)\n annex_letter -> annex_letter (string)\n }\n\n test {\n accept \"G1040\"\n accept \"GA1040\"\n accept \"IALA S1070 Ed 2.0\"\n accept \"R1016:ed2.0(F)\"\n accept \"C0103-1 Ed 3.0\"\n accept \"IALA L2.1.11 Ed 2\"\n accept \"IALA G1128 Annex A Ed 1.6\"\n accept \"IALA G1045 Annex Ed 1\"\n accept \"IALA A12-01 (E)\"\n reject \"nonsense\"\n example \"G1040\" { type_letter: \"G\", doc_number: \"1040\" }\n example \"GA01.01\" {\n type_letter: \"GA\",\n doc_number: \"01\",\n doc_number_dots: [ { dotted_segment: \"01\" } ],\n }\n example \"C0103-1\" {\n type_letter: \"C\",\n doc_number: \"0103\",\n subpart: [ { subpart_number: \"1\" } ],\n }\n example \"IALA S1070 Ed 2.0\" {\n type_letter: \"S\",\n doc_number: \"1070\",\n edition_value: \"2.0\",\n }\n example \"IALA G1128 Annex A Ed 1.6\" {\n type_letter: \"G\",\n doc_number: \"1128\",\n annex_marker: \"Annex\",\n annex_letter: \"A\",\n edition_value: \"1.6\",\n }\n }\n}\n","source_hash":"876c56b59effe0fff6067618955aa411a9d5287848c677b093aacc830562d000","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":2,"checksum":"sha256:78c7be794cd2a2cc4538d1bdbd276f8a2533eea4dd91a3a516ec5c1ce117ea56"}
|