pubid 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/parg/adobe.json +1 -1
- data/data/parg/amca.json +1 -1
- data/data/parg/ansi.json +1 -1
- data/data/parg/api.json +1 -1
- data/data/parg/ashrae.json +1 -1
- data/data/parg/asme.json +1 -1
- data/data/parg/astm.json +1 -1
- data/data/parg/bipm.json +1 -1
- data/data/parg/bsi.json +1 -1
- data/data/parg/ccsds.json +1 -1
- data/data/parg/cen_cenelec.json +1 -1
- data/data/parg/cie.json +1 -1
- data/data/parg/csa.json +1 -1
- data/data/parg/ecma.json +1 -1
- data/data/parg/etsi.json +1 -1
- data/data/parg/evs.json +1 -1
- data/data/parg/gost.json +1 -1
- data/data/parg/iana.json +1 -1
- data/data/parg/idf.json +1 -1
- data/data/parg/iec.json +1 -1
- data/data/parg/iho.json +1 -0
- data/data/parg/isbn.json +1 -1
- data/data/parg/itu.json +1 -1
- data/data/parg/jcgm.json +1 -1
- data/data/parg/jis.json +1 -1
- data/data/parg/nist.json +1 -1
- data/data/parg/oiml.json +1 -1
- data/data/parg/omg.json +1 -1
- data/data/parg/plateau.json +1 -1
- data/data/parg/tgpp.json +1 -1
- data/data/parg/un.json +1 -1
- data/lib/pubid/adobe/identifier.rb +1 -1
- data/lib/pubid/adobe/parser.rb +2 -113
- data/lib/pubid/amca/identifiers/base.rb +1 -1
- data/lib/pubid/amca/parser.rb +1 -145
- data/lib/pubid/ansi/identifier.rb +1 -1
- data/lib/pubid/ansi/parser.rb +1 -82
- data/lib/pubid/api/builder.rb +32 -1
- data/lib/pubid/api/identifier.rb +1 -1
- data/lib/pubid/api/parser.rb +1 -131
- data/lib/pubid/ashrae/identifiers/base.rb +1 -1
- data/lib/pubid/ashrae/parser.rb +3 -710
- data/lib/pubid/asme/builder.rb +6 -4
- data/lib/pubid/asme/identifier.rb +1 -2
- data/lib/pubid/asme/parser.rb +1 -328
- data/lib/pubid/astm/builder.rb +12 -3
- data/lib/pubid/astm/identifier.rb +1 -2
- data/lib/pubid/astm/parser.rb +1 -227
- data/lib/pubid/bipm/identifier.rb +8 -1
- data/lib/pubid/bipm/parser.rb +2 -224
- data/lib/pubid/bsi/builder.rb +2 -4
- data/lib/pubid/bsi/parser.rb +1 -666
- data/lib/pubid/bsi/single_identifier.rb +38 -1
- data/lib/pubid/calconnect/parser.rb +2 -40
- data/lib/pubid/ccsds/identifier.rb +1 -1
- data/lib/pubid/ccsds/parser.rb +1 -66
- data/lib/pubid/cen_cenelec/identifier.rb +16 -1
- data/lib/pubid/cen_cenelec/parser.rb +3 -136
- data/lib/pubid/cie/identifier.rb +1 -1
- data/lib/pubid/cie/parser.rb +3 -378
- data/lib/pubid/conformance.rb +1 -1
- data/lib/pubid/csa/builder.rb +41 -18
- data/lib/pubid/csa/identifier.rb +12 -4
- data/lib/pubid/csa/identifiers/amendment.rb +28 -0
- data/lib/pubid/csa/identifiers.rb +1 -0
- data/lib/pubid/csa/parser.rb +16 -397
- data/lib/pubid/doi/parser.rb +2 -37
- data/lib/pubid/easc/builder.rb +1 -1
- data/lib/pubid/easc/parser.rb +2 -70
- data/lib/pubid/ecma/CLAUDE.md +8 -1
- data/lib/pubid/ecma/identifier.rb +13 -8
- data/lib/pubid/ecma/parser.rb +2 -54
- data/lib/pubid/ecma/renderer.rb +3 -7
- data/lib/pubid/errors.rb +18 -13
- data/lib/pubid/etsi/builder.rb +8 -5
- data/lib/pubid/etsi/identifiers/base.rb +1 -1
- data/lib/pubid/etsi/parser.rb +1 -132
- data/lib/pubid/evs/identifier.rb +7 -0
- data/lib/pubid/evs/parser.rb +1 -8
- data/lib/pubid/evs.rb +1 -1
- data/lib/pubid/gb/identifier.rb +6 -0
- data/lib/pubid/gb/parser.rb +2 -51
- data/lib/pubid/gost/identifier.rb +9 -1
- data/lib/pubid/gost/parser.rb +4 -81
- data/lib/pubid/iala/parser.rb +2 -121
- data/lib/pubid/iana/identifier.rb +1 -1
- data/lib/pubid/iana/parser.rb +2 -24
- data/lib/pubid/identifier.rb +78 -1
- data/lib/pubid/idf/builder.rb +42 -0
- data/lib/pubid/idf/identifier.rb +1 -1
- data/lib/pubid/idf/parser.rb +1 -137
- data/lib/pubid/idf.rb +1 -2
- data/lib/pubid/iec/builder.rb +158 -50
- data/lib/pubid/iec/identifier.rb +1 -1
- data/lib/pubid/iec/parser.rb +3 -430
- data/lib/pubid/ieee/aiee/identifier.rb +2 -1
- data/lib/pubid/ieee/aiee.rb +0 -1
- data/lib/pubid/ieee/builder.rb +2 -2
- data/lib/pubid/ieee/identifiers/base.rb +1 -1
- data/lib/pubid/ieee/ire/identifier.rb +2 -1
- data/lib/pubid/ieee/ire.rb +0 -1
- data/lib/pubid/ieee/nesc.rb +0 -1
- data/lib/pubid/ieee/parser.rb +1 -1257
- data/lib/pubid/ietf/identifiers/base.rb +17 -1
- data/lib/pubid/ietf/parser.rb +2 -47
- data/lib/pubid/ietf/renderer.rb +17 -2
- data/lib/pubid/iho/CLAUDE.md +89 -0
- data/lib/pubid/iho/builder.rb +4 -1
- data/lib/pubid/iho/identifiers/base.rb +28 -2
- data/lib/pubid/iho/renderer.rb +8 -0
- data/lib/pubid/iho/urn_generator.rb +11 -1
- data/lib/pubid/iho/urn_parser.rb +21 -11
- data/lib/pubid/iho.rb +0 -1
- data/lib/pubid/isbn/identifier.rb +1 -1
- data/lib/pubid/isbn/parser.rb +2 -31
- data/lib/pubid/iso/builder.rb +1 -1
- data/lib/pubid/iso/identifiers/directives.rb +6 -3
- data/lib/pubid/iso/identifiers/guide.rb +6 -3
- data/lib/pubid/iso/identifiers/international_workshop_agreement.rb +6 -3
- data/lib/pubid/iso/normalizer.rb +1 -1
- data/lib/pubid/iso/parser.rb +1 -539
- data/lib/pubid/iso/supplement_identifier.rb +6 -3
- data/lib/pubid/iso/utilities.rb +4 -5
- data/lib/pubid/iso.rb +1 -19
- data/lib/pubid/itu/builder.rb +36 -20
- data/lib/pubid/itu/identifiers/base.rb +15 -2
- data/lib/pubid/itu/parser.rb +1 -775
- data/lib/pubid/jcgm/builder.rb +35 -0
- data/lib/pubid/jcgm/parser.rb +1 -151
- data/lib/pubid/jcgm.rb +1 -2
- data/lib/pubid/jis/builder.rb +18 -29
- data/lib/pubid/jis/identifier.rb +1 -1
- data/lib/pubid/jis/parser.rb +1 -128
- data/lib/pubid/nist/builder.rb +5 -1
- data/lib/pubid/nist/caster.rb +13 -3
- data/lib/pubid/nist/identifiers/base.rb +37 -2
- data/lib/pubid/nist/identifiers/circular.rb +2 -2
- data/lib/pubid/nist/identifiers/circular_supplement.rb +2 -2
- data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +2 -2
- data/lib/pubid/nist/identifiers/crpl_report.rb +2 -2
- data/lib/pubid/nist/identifiers/handbook.rb +2 -2
- data/lib/pubid/nist/identifiers/internal_report.rb +2 -2
- data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +2 -2
- data/lib/pubid/nist/identifiers/monograph.rb +2 -2
- data/lib/pubid/nist/identifiers/report.rb +2 -2
- data/lib/pubid/nist/parser.rb +19 -775
- data/lib/pubid/nist/router.rb +4 -1
- data/lib/pubid/nist/supplement_identifier.rb +2 -2
- data/lib/pubid/oasis/parser.rb +2 -16
- data/lib/pubid/ogc/parser.rb +2 -26
- data/lib/pubid/oiml/identifiers/certification_system.rb +7 -0
- data/lib/pubid/oiml/identifiers/dual_published.rb +2 -2
- data/lib/pubid/oiml/parser.rb +1 -303
- data/lib/pubid/oiml.rb +1 -2
- data/lib/pubid/omg/identifier.rb +6 -1
- data/lib/pubid/omg/parser.rb +2 -76
- data/lib/pubid/parser.rb +5 -4
- data/lib/pubid/parsers/mr_string.rb +1 -1
- data/lib/pubid/plateau/parser.rb +1 -66
- data/lib/pubid/plateau.rb +1 -2
- data/lib/pubid/renderers/directives_renderer.rb +1 -1
- data/lib/pubid/renderers/iwa_renderer.rb +1 -1
- data/lib/pubid/renderers/publisher_stripper.rb +82 -0
- data/lib/pubid/renderers/supplement_renderer.rb +1 -1
- data/lib/pubid/renderers.rb +1 -0
- data/lib/pubid/sae/parser.rb +1 -48
- data/lib/pubid/tgpp/identifier.rb +1 -1
- data/lib/pubid/tgpp/parser.rb +2 -59
- data/lib/pubid/un/identifier.rb +1 -1
- data/lib/pubid/un/parser.rb +1 -18
- data/lib/pubid/version.rb +1 -1
- data/lib/pubid/w3c/parser.rb +2 -27
- data/lib/pubid/xsf/identifier.rb +10 -6
- data/lib/pubid/xsf/parser.rb +3 -31
- data/lib/pubid/xsf/renderer.rb +2 -4
- data/lib/pubid.rb +8 -9
- metadata +6 -23
- data/lib/pubid/ieee/aiee/parser.rb +0 -130
- data/lib/pubid/ieee/ire/parser.rb +0 -109
- data/lib/pubid/ieee/nesc/parser.rb +0 -155
- data/lib/pubid/iho/parser.rb +0 -68
- data/lib/pubid/parser/common_parse_methods.rb +0 -13
- data/lib/pubid/parser/common_parse_rules.rb +0 -56
- data/lib/pubid/parser/grammar.rb +0 -96
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e63056b353ea7108c6534d459fcf787121323150318ac6a739e74d012aa70ee1
|
|
4
|
+
data.tar.gz: c8fc6464b172356a66918e0fc92dacf937963eed8c4712b42aba89c3165d51f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d62d14de32a0e709f387e8146f2bb4f88295cd172702e84f906f586af3744c21a0dd957581b25388364cd54b2a295ca44b500d48ecbb92417b0eb967bfe1be66
|
|
7
|
+
data.tar.gz: 2675f5ae5eef3819783f61f11e4260fb79bc6e7705ccda90ebc4ffa66120a17df2130b9922178e444358568723f947a545583f81f6c92a85a598e1f874ef4c61
|
data/data/parg/adobe.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidAdobe","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":
|
|
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/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":
|
|
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"}
|