@pubid/pubid 0.1.56 → 0.1.58

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.
@@ -774,8 +774,23 @@ export class IsoTcDocument extends IsoIdentifier {
774
774
  wg_type: { type: "string" },
775
775
  wg_number: { type: "string" },
776
776
  });
777
- static mappings = keyValue({ wire: "tc_type", to: "tc_type" }, { wire: "tc_number", to: "tc_number" }, { wire: "sc_type", to: "sc_type" }, { wire: "sc_number", to: "sc_number" }, { wire: "wg_type", to: "wg_type" }, { wire: "wg_number", to: "wg_number" }, { wire: "number", to: "number" }, ...dateTrio(), { wire: "publisher", to: "publisher" });
777
+ static mappings = keyValue({ wire: "tc_type", to: "tc_type" }, { wire: "tc_number", to: "tc_number" }, { wire: "sc_type", to: "sc_type" }, { wire: "sc_number", to: "sc_number" }, { wire: "wg_type", to: "wg_type" }, { wire: "wg_number", to: "wg_number" }, { wire: "number", to: "number" }, ...dateTrio(),
778
+ // The gem's inherited mapping + default-drop semantics: the ISO
779
+ // publisher stays off the wire, a non-ISO publisher emits ("IEC/TC
780
+ // 10 N 5" keeps publisher: "IEC").
781
+ ...publisherMappings());
778
782
  static urnGenerator = IsoUrnGenerator;
783
+ constructor(attrs = {}) {
784
+ super(attrs);
785
+ // The gem materializes the publisher default on every construction
786
+ // path (parse, from_hash, the bare-TC route): a TC document always
787
+ // carries a publisher (ISO unless the face names another), so
788
+ // from_hash of a default-published row renders the full face.
789
+ const self = this;
790
+ if (self["publisher"] === undefined) {
791
+ self["publisher"] = new IsoPublisher({});
792
+ }
793
+ }
779
794
  render() {
780
795
  let result = this.publisher === undefined ? "" : this.publisher.render();
781
796
  if (this.tc_type !== undefined && this.tc_type !== "")
@@ -93,6 +93,15 @@ const KIND_PREFIXES = {
93
93
  "technical-specification": "TS",
94
94
  };
95
95
  class JisIdentifier extends BaseIdentifier {
96
+ // The bare SYMBOL face (`symbol: ""`, rendered "…SYMBOL") and the
97
+ // no-symbol face (`symbol` undefined) are distinct states of a
98
+ // two-valued attribute — the match is absolute equality, blank-vs-blank
99
+ // included (the gem's subset_attribute_match? override, pubid main
100
+ // ef8f041c / 2.0.45). Declared exact-blank rather than strict: the
101
+ // strict nil≈empty shortcut is exactly the tolerance this law rejects,
102
+ // and the gem likewise routes :symbol before both strict and value
103
+ // matching.
104
+ static subsetExactBlanks = ["symbol"];
96
105
  /** The rendered document code, e.g. "B 0205-1". */
97
106
  code() {
98
107
  if (this.base !== undefined)
@@ -35,6 +35,7 @@
35
35
  */
36
36
  import "./amca/model.js";
37
37
  import "./api/model.js";
38
+ import "./arxiv/model.js";
38
39
  import "./ashrae/model.js";
39
40
  import "./asme/model.js";
40
41
  import "./astm/model.js";
@@ -42,6 +43,7 @@ import "./bsi/model.js";
42
43
  import "./cen_cenelec/model.js";
43
44
  import "./cie/model.js";
44
45
  import "./csa/model.js";
46
+ import "./eu/model.js";
45
47
  import "./evs/model.js";
46
48
  import "./gost/model.js";
47
49
  import "./idf/model.js";
@@ -36,6 +36,7 @@
36
36
  // Model-registrant flavors: registration lives in <flavor>/model.js.
37
37
  import "./amca/model.js";
38
38
  import "./api/model.js";
39
+ import "./arxiv/model.js";
39
40
  import "./ashrae/model.js";
40
41
  import "./asme/model.js";
41
42
  import "./astm/model.js";
@@ -43,6 +44,7 @@ import "./bsi/model.js";
43
44
  import "./cen_cenelec/model.js";
44
45
  import "./cie/model.js";
45
46
  import "./csa/model.js";
47
+ import "./eu/model.js";
46
48
  import "./evs/model.js";
47
49
  import "./gost/model.js";
48
50
  import "./idf/model.js";
@@ -18,7 +18,16 @@
18
18
  * - A STRICT attribute (class `subsetStrict` declaration) is exempt from the
19
19
  * wildcards: the reference always states it, a stated collection must match
20
20
  * in full, and nested matches run in BOTH directions with the class's own
21
- * rule.
21
+ * rule. A blank strict attribute still matches a blank candidate (nil≈empty,
22
+ * the from_hash-dropped-empty tolerance).
23
+ * - An EXACT-BLANK attribute (class `subsetExactBlanks` declaration) goes
24
+ * further: it compares by ABSOLUTE equality, so even blank-vs-blank must
25
+ * hold the same value. The bare SYMBOL face (`symbol: ""`, rendered
26
+ * "…SYMBOL") and the no-symbol face (`symbol` undefined) do not match
27
+ * either way. This is the mirror of the Ruby per-flavor
28
+ * `subset_attribute_match?` overrides (lib/pubid/jis/identifier.rb, pubid
29
+ * main ef8f041c); strict attributes of flavors that do not opt in keep the
30
+ * blank-blank shortcut.
22
31
  * - A reference with `allParts` set skips part/parts/subpart/allParts.
23
32
  * - Nested identifiers and components recurse with their own match; every
24
33
  * other value compares with deep scalar equality.
@@ -18,7 +18,16 @@
18
18
  * - A STRICT attribute (class `subsetStrict` declaration) is exempt from the
19
19
  * wildcards: the reference always states it, a stated collection must match
20
20
  * in full, and nested matches run in BOTH directions with the class's own
21
- * rule.
21
+ * rule. A blank strict attribute still matches a blank candidate (nil≈empty,
22
+ * the from_hash-dropped-empty tolerance).
23
+ * - An EXACT-BLANK attribute (class `subsetExactBlanks` declaration) goes
24
+ * further: it compares by ABSOLUTE equality, so even blank-vs-blank must
25
+ * hold the same value. The bare SYMBOL face (`symbol: ""`, rendered
26
+ * "…SYMBOL") and the no-symbol face (`symbol` undefined) do not match
27
+ * either way. This is the mirror of the Ruby per-flavor
28
+ * `subset_attribute_match?` overrides (lib/pubid/jis/identifier.rb, pubid
29
+ * main ef8f041c); strict attributes of flavors that do not opt in keep the
30
+ * blank-blank shortcut.
22
31
  * - A reference with `allParts` set skips part/parts/subpart/allParts.
23
32
  * - Nested identifiers and components recurse with their own match; every
24
33
  * other value compares with deep scalar equality.
@@ -96,6 +105,18 @@ export function exactMatch(mine, theirs) {
96
105
  }
97
106
  return scalarEqual(mine, theirs);
98
107
  }
108
+ /**
109
+ * An EXACT-BLANK attribute is stated even when blank: the two faces are
110
+ * compared by absolute equality, blank-vs-blank included. This is the
111
+ * per-class mirror of the Ruby flavor's `subset_attribute_match?` override
112
+ * (the JIS symbol law: the bare SYMBOL face and no symbol are distinct
113
+ * states of a two-valued attribute — pubid main ef8f041c). `exactMatch`
114
+ * keeps its blank-blank shortcut for the strict attributes that rely on
115
+ * the from_hash-dropped-empty tolerance.
116
+ */
117
+ function exactBlankMatch(mine, theirs) {
118
+ return scalarEqual(mine, theirs);
119
+ }
99
120
  /**
100
121
  * True when `candidate` holds every part that `reference` states. Both must
101
122
  * be identifiers or components of the same concrete class.
@@ -115,8 +136,17 @@ export function subsetMatch(reference, candidate) {
115
136
  return JSON.stringify(a) === JSON.stringify(b);
116
137
  }
117
138
  const strict = new Set(ctor.subsetStrict ?? []);
139
+ const exactBlanks = new Set(ctor.subsetExactBlanks ?? []);
118
140
  const ignored = new Set([
119
141
  ...(ctor.subsetIgnoredAttributes ?? []),
142
+ // Ruby SubsetMatch#subset_skipped_attributes also skips every
143
+ // `equality_ignored` attribute ("skipped, as == and hash skip it") —
144
+ // jis's language_before_year, eu's number_first (the print ORDER of
145
+ // the two numbers is spelling, so "EU Decision 1082/2013" ===
146
+ // 32013D1082).
147
+ ...Object.entries(ctor.attributes)
148
+ .filter(([, spec]) => spec?.equalityIgnored === true)
149
+ .map(([name]) => name),
120
150
  ...(reference.subsetAllPartsWildcard?.()
121
151
  ? ALL_PARTS_ATTRIBUTES
122
152
  : []),
@@ -127,6 +157,10 @@ export function subsetMatch(reference, candidate) {
127
157
  return true;
128
158
  const mine = reference[name];
129
159
  const theirs = candidate[name];
160
+ // Exact-blank names route before the strict rule: their blanks are
161
+ // distinct values, not the nil≈empty tolerance.
162
+ if (exactBlanks.has(name))
163
+ return exactBlankMatch(mine, theirs);
130
164
  if (strict.has(name))
131
165
  return exactMatch(mine, theirs);
132
166
  return valueMatch(mine, theirs);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The pubid-scheme URN schema of ARXIV — the transcription
3
+ * of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
4
+ * #670; design in docs/URN-SCHEMES.adoc). GENERATED by
5
+ * scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
6
+ * schema and regenerate, never this table by hand.
7
+ */
8
+ export declare const arxivSchema: import("../schema.js").FlavorSchema;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The pubid-scheme URN schema of ARXIV — the transcription
3
+ * of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
4
+ * #670; design in docs/URN-SCHEMES.adoc). GENERATED by
5
+ * scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
6
+ * schema and regenerate, never this table by hand.
7
+ */
8
+ import { define } from "../index.js";
9
+ export const arxivSchema = define("arxiv", (s) => {
10
+ s.atom("archive", "archive");
11
+ s.atom("subject_class", "sc");
12
+ s.atom("version", "v", "int");
13
+ s.type("pubid:arxiv:eprint", "eprint", { core: [["year", "int"], ["month", "int"], "number"] });
14
+ s.type("pubid:arxiv:identifier", "id", { core: [["year", "int"], ["month", "int"], "number"] });
15
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The pubid-scheme URN schema of EU — the transcription
3
+ * of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
4
+ * #670; design in docs/URN-SCHEMES.adoc). GENERATED by
5
+ * scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
6
+ * schema and regenerate, never this table by hand.
7
+ */
8
+ export declare const euSchema: import("../schema.js").FlavorSchema;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The pubid-scheme URN schema of EU — the transcription
3
+ * of lib/pubid/<flavor>/pubid_urn_schema.rb (pubid#656, completed by
4
+ * #670; design in docs/URN-SCHEMES.adoc). GENERATED by
5
+ * scripts/port-urn-schemas.rb from the ruby declaration: edit the ruby
6
+ * schema and regenerate, never this table by hand.
7
+ */
8
+ import { define } from "../index.js";
9
+ export const euSchema = define("eu", (s) => {
10
+ s.atom("family", "family");
11
+ s.facet("number_first", "numberfirst", "bool");
12
+ s.type("pubid:eu:regulation", "reg", { core: ["year", "number"] });
13
+ s.type("pubid:eu:directive", "dir", { core: ["year", "number"] });
14
+ s.type("pubid:eu:decision", "dec", { core: ["year", "number"] });
15
+ });
@@ -5,6 +5,7 @@
5
5
  * pubid-urn module builds its flavor lookup lazily from this array.
6
6
  */
7
7
  import { adobeSchema } from "./adobe.js";
8
+ import { arxivSchema } from "./arxiv.js";
8
9
  import { amcaSchema } from "./amca.js";
9
10
  import { ansiSchema } from "./ansi.js";
10
11
  import { apiSchema } from "./api.js";
@@ -26,6 +27,7 @@ import { eascSchema } from "./easc.js";
26
27
  import { ecmaSchema } from "./ecma.js";
27
28
  import { etsiSchema } from "./etsi.js";
28
29
  import { etsiPfsSchema } from "./etsi_pfs.js";
30
+ import { euSchema } from "./eu.js";
29
31
  import { evsSchema } from "./evs.js";
30
32
  import { gbSchema } from "./gb.js";
31
33
  import { gostSchema } from "./gost.js";
@@ -55,6 +57,7 @@ import { xsfSchema } from "./xsf.js";
55
57
  /** All flavor schemas, in the ruby registry order (alphabetical by module). */
56
58
  export const PUBID_URN_SCHEMAS = [
57
59
  adobeSchema,
60
+ arxivSchema,
58
61
  amcaSchema,
59
62
  ansiSchema,
60
63
  apiSchema,
@@ -76,6 +79,7 @@ export const PUBID_URN_SCHEMAS = [
76
79
  ecmaSchema,
77
80
  etsiSchema,
78
81
  etsiPfsSchema,
82
+ euSchema,
79
83
  evsSchema,
80
84
  gbSchema,
81
85
  gostSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pubid/pubid",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "description": "TypeScript PubID identifiers: resolution, normalization and canonical hashes for every identifier in the pubid-testsuite corpus (41 standards bodies), with a conformance runner mirroring the Ruby reference",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1 @@
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidArxiv","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":8}},{"Re":{"pattern":"(?i:arXiv)"}},{"Entity":{"atom":3}},{"Str":{"pattern":":"}},{"Named":{"name":"colon","atom":2}},{"Entity":{"atom":6}},{"Str":{"pattern":" "}},{"Alternative":{"atoms":[4,5]}},{"Sequence":{"atoms":[1,7]}},{"Repetition":{"atom":0,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":21}},{"Entity":{"atom":15}},{"Entity":{"atom":13}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":12,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"yymm","atom":14}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Entity":{"atom":13}},{"Repetition":{"atom":18,"min":4,"max":5,"tag":"Repetition"}},{"Named":{"name":"number","atom":19}},{"Sequence":{"atoms":[11,16,17]}},{"Entity":{"atom":52}},{"Entity":{"atom":31}},{"Entity":{"atom":25}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Entity":{"atom":25}},{"Str":{"pattern":"-"}},{"Alternative":{"atoms":[26,27]}},{"Repetition":{"atom":28,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[24,29]}},{"Named":{"name":"archive","atom":30}},{"Str":{"pattern":"."}},{"Entity":{"atom":43}},{"Entity":{"atom":37}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[35,36]}},{"Entity":{"atom":37}},{"Str":{"pattern":"-"}},{"Alternative":{"atoms":[38,39]}},{"Repetition":{"atom":40,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[34,41]}},{"Named":{"name":"subject_class","atom":42}},{"Sequence":{"atoms":[32,33]}},{"Repetition":{"atom":44,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"/"}},{"Entity":{"atom":15}},{"Entity":{"atom":51}},{"Entity":{"atom":13}},{"Repetition":{"atom":49,"min":3,"max":3,"tag":"Repetition"}},{"Named":{"name":"number","atom":50}},{"Sequence":{"atoms":[23,45,46,47,48]}},{"Alternative":{"atoms":[10,22]}},{"Entity":{"atom":59}},{"Str":{"pattern":"v"}},{"Entity":{"atom":13}},{"Repetition":{"atom":56,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"version","atom":57}},{"Sequence":{"atoms":[55,58]}},{"Repetition":{"atom":54,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[9,53,60]}}],"root":61},"bindings":[{"capture":"archive","path":"archive","type":"string","card":null,"preprocess":null},{"capture":"subject_class","path":"subject_class","type":"string","card":null,"preprocess":null},{"capture":"yymm","path":"yymm","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"arXiv:2301.00001v1","expect":{}},{"entry":"identifier","kind":"accept","input":"arxiv:0704.0001","expect":{}},{"entry":"identifier","kind":"accept","input":"arXiv hep-th/9901001v2","expect":{}},{"entry":"identifier","kind":"accept","input":"math.GT/0309136","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"2301.001","expect":{}},{"entry":"identifier","kind":"reject","input":"hep-th/99010","expect":{}},{"entry":"identifier","kind":"example","input":"arXiv:2301.00001v1","expect":{"yymm":"2301","number":"00001","version":"1"}},{"entry":"identifier","kind":"example","input":"0704.0001","expect":{"yymm":"0704","number":"0001"}},{"entry":"identifier","kind":"example","input":"hep-th/9901001","expect":{"archive":"hep-th","yymm":"9901","number":"001"}},{"entry":"identifier","kind":"example","input":"math.GT/0309136v2","expect":{"archive":"math","subject_class":"GT","yymm":"0309","number":"136","version":"2"}}],"docs":{},"source":"# arXiv e-print identifiers, per\n# https://info.arxiv.org/help/arxiv_identifier_for_services.html:\n# new form YYMM.NNNN[vN] (0704-1412) and YYMM.NNNNN[vN] (1501 onward)\n# old form archive[.SC]/YYMMNNN[vN] (9108-0703)\n# with an optional, case-insensitive \"arXiv:\" or \"arXiv \" prefix.\n# The date ranges, the month and v0 are checked by the Ruby builder.\n\ngrammar PubidArxiv version \"0.1.0\" edition 2 {\n digit = %x30-39\n lower = %x61-7A\n letter = %x41-5A / %x61-7A\n arxiv_prefix = %i\"arXiv\" (colon / space)\n yymm = (4digit) as yymm\n new_number = (4*5digit) as number\n new_id = yymm \".\" new_number\n archive = (lower *(lower / \"-\")) as archive\n subject_class = (letter *(letter / \"-\")) as subject_class\n old_number = (3digit) as number\n old_id = archive [\".\" subject_class] \"/\" yymm old_number\n version = \"v\" (1*digit) as version\n identifier = [arxiv_prefix] (new_id / old_id) [version]\n space = \" \"\n colon = \":\"\n entry identifier: identifier\n\n # Typed model bindings: every bound capture lands on the\n # consumer model's field of the same name.\n bindings identifier {\n archive -> archive (string)\n subject_class -> subject_class (string)\n yymm -> yymm (string)\n number -> number (string)\n version -> version (string)\n }\n\n\n test {\n accept \"arXiv:2301.00001v1\"\n accept \"arxiv:0704.0001\"\n accept \"arXiv hep-th/9901001v2\"\n accept \"math.GT/0309136\"\n reject \"nonsense\"\n reject \"2301.001\"\n reject \"hep-th/99010\"\n example \"arXiv:2301.00001v1\" { yymm: \"2301\" number: \"00001\" version: \"1\" }\n example \"0704.0001\" { yymm: \"0704\" number: \"0001\" }\n example \"hep-th/9901001\" { archive: \"hep-th\" yymm: \"9901\" number: \"001\" }\n example \"math.GT/0309136v2\" { archive: \"math\" subject_class: \"GT\" yymm: \"0309\" number: \"136\" version: \"2\" }\n }\n}\n","source_hash":"c4b4676d738856a7717100c2a3a0545fa1e5a6b83fbf8b09b08dcbe1c33c4a5e","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:a7a76fd8f3dbc2635edef63cbb9451aba802e36dea8c4b616ddfdeed626834d1","checksum":"sha256:123c27a1f1a4e2f0744d39b70828f66e48bf2841168011daf0dc5b8a6034523e","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":11,"tests_failures":0,"self_test":true}}
@@ -1 +1 @@
1
- {"bindings":null,"version":"0.1.0","grammar":"PubidBsiPfs","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":7}},{"Str":{"pattern":"BS"}},{"Str":{"pattern":"PAS"}},{"Str":{"pattern":"PD"}},{"Str":{"pattern":"DD"}},{"Str":{"pattern":"TS"}},{"Alternative":{"atoms":[1,2,3,4,5]}},{"Named":{"name":"publisher","atom":6}},{"Str":{"pattern":" "}},{"Entity":{"atom":66}},{"Str":{"pattern":"EN"}},{"Str":{"pattern":"CEN"}},{"Str":{"pattern":"CLC"}},{"Str":{"pattern":"HD"}},{"Str":{"pattern":"ENV"}},{"Str":{"pattern":"ES"}},{"Str":{"pattern":"CR"}},{"Str":{"pattern":"CWA"}},{"Str":{"pattern":"ISO"}},{"Str":{"pattern":"IEC"}},{"Alternative":{"atoms":[10,11,12,13,14,15,16,17,18,19]}},{"Entity":{"atom":58}},{"Entity":{"atom":42}},{"Str":{"pattern":"/"}},{"Named":{"name":"supplements_slash","atom":23}},{"Str":{"pattern":"+"}},{"Named":{"name":"supplements_plus","atom":25}},{"Alternative":{"atoms":[24,26]}},{"Str":{"pattern":"A"}},{"Named":{"name":"supplement_kind","atom":28}},{"Entity":{"atom":34}},{"Entity":{"atom":32}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":31,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplement_number","atom":33}},{"Str":{"pattern":":"}},{"Entity":{"atom":39}},{"Entity":{"atom":32}},{"Repetition":{"atom":37,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"supplements_year","atom":38}},{"Sequence":{"atoms":[35,36]}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[27,29,30,41]}},{"Entity":{"atom":56}},{"Str":{"pattern":"/"}},{"Named":{"name":"supplements_slash","atom":44}},{"Str":{"pattern":"+"}},{"Named":{"name":"supplements_plus","atom":46}},{"Alternative":{"atoms":[45,47]}},{"Str":{"pattern":"C"}},{"Named":{"name":"supplement_kind","atom":49}},{"Entity":{"atom":34}},{"Str":{"pattern":":"}},{"Entity":{"atom":39}},{"Sequence":{"atoms":[52,53]}},{"Repetition":{"atom":54,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[48,50,51,55]}},{"Alternative":{"atoms":[22,43]}},{"Named":{"name":"supplement","atom":57}},{"Lookahead":{"atom":21,"positive":false}},{"Re":{"pattern":"[\\x01-\\x09]"}},{"Re":{"pattern":"[\\x0b-\\u{10ffff}]"}},{"Alternative":{"atoms":[60,61]}},{"Sequence":{"atoms":[59,62]}},{"Repetition":{"atom":63,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[20,64]}},{"Named":{"name":"adopted","atom":65}},{"Sequence":{"atoms":[0,8,9]}},{"Entity":{"atom":7}},{"Str":{"pattern":" "}},{"Entity":{"atom":76}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":71,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":73,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[72,74]}},{"Named":{"name":"number","atom":75}},{"Str":{"pattern":"-"}},{"Entity":{"atom":96}},{"Entity":{"atom":32}},{"Entity":{"atom":83}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[81,82]}},{"Alternative":{"atoms":[79,80]}},{"Repetition":{"atom":84,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Str":{"pattern":"-"}},{"Alternative":{"atoms":[86,87]}},{"Entity":{"atom":32}},{"Entity":{"atom":83}},{"Alternative":{"atoms":[89,90]}},{"Repetition":{"atom":91,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[88,92]}},{"Repetition":{"atom":93,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[85,94]}},{"Named":{"name":"part","atom":95}},{"Sequence":{"atoms":[77,78]}},{"Repetition":{"atom":97,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":":"}},{"Entity":{"atom":103}},{"Entity":{"atom":32}},{"Repetition":{"atom":101,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":102}},{"Sequence":{"atoms":[99,100]}},{"Repetition":{"atom":104,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[68,69,70,98,105]}},{"Alternative":{"atoms":[67,106]}},{"Entity":{"atom":111}},{"Entity":{"atom":58}},{"Repetition":{"atom":109,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplements","atom":110}},{"Repetition":{"atom":108,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[107,112]}}],"root":113},"bindings":[{"capture":"publisher","path":"publisher","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":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"adopted","path":"adopted","type":"string","card":null,"preprocess":null},{"capture":"supplement","path":"supplements[].supplement","type":"raw","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"BS 10005:1995","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 1016-107.2:1991","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 1344-A1:1960","expect":{}},{"entry":"identifier","kind":"accept","input":"PD 5730","expect":{}},{"entry":"identifier","kind":"accept","input":"PAS 003:1994","expect":{}},{"entry":"identifier","kind":"accept","input":"DD 136-2:1986","expect":{}},{"entry":"identifier","kind":"accept","input":"TS 1:1995","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN 1073-2:2002","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN ISO 105-B06:2020","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN IEC 61851-1:2019","expect":{}},{"entry":"identifier","kind":"accept","input":"BS ISO 8601:2019","expect":{}},{"entry":"identifier","kind":"accept","input":"BS IEC 60747-8:2000","expect":{}},{"entry":"identifier","kind":"accept","input":"BS HD 60269-3","expect":{}},{"entry":"identifier","kind":"accept","input":"DD CEN ISO/TS 12180-1:2007","expect":{}},{"entry":"identifier","kind":"accept","input":"DD CLC/TS 50131-2-2:2004","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN IEC 60601-1/FRAG1","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN IEC 61535/AMD1/FRAG1","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 10125:2014+A1:2016","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN 1005-1:2001+A1:2008","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 646:1958+A2:2013","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"BS","expect":{}},{"entry":"identifier","kind":"reject","input":"EN 1325","expect":{}},{"entry":"identifier","kind":"reject","input":"ISO 9001:2015","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 2X 26:2001","expect":{}},{"entry":"identifier","kind":"reject","input":"DISC PD 0005:1995","expect":{}},{"entry":"identifier","kind":"reject","input":"BS A 103:2025","expect":{}},{"entry":"identifier","kind":"reject","input":"BSI Flex 1886 v2.0:2024-09","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 7671 AMD2","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1000[9]:1971","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1580:Parts 1 and 2:1962","expect":{}},{"entry":"identifier","kind":"reject","input":"BS CISPR 12:1997","expect":{}},{"entry":"identifier","kind":"reject","input":"14/30300822 DC","expect":{}},{"entry":"identifier","kind":"reject","input":"NA to BS EN 1996-1-2:2005","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 7722:2006 BOOK","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 31100:2021 ExComm","expect":{}},{"entry":"identifier","kind":"reject","input":"AMD 11015","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1425:Supplement No. 1:1966","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 185 Index:1962","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 2782-10:Method 1006:1978","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1902-2.3:Addendum No. 1:1976","expect":{}},{"entry":"identifier","kind":"example","input":"BS 10005:1995","expect":{"publisher":"BS","number":"10005","year":"1995"}},{"entry":"identifier","kind":"example","input":"BS 1016-107.2:1991","expect":{"publisher":"BS","number":"1016","part":"107.2","year":"1991"}},{"entry":"identifier","kind":"example","input":"BS 1344-A1:1960","expect":{"publisher":"BS","number":"1344","part":"A1","year":"1960"}},{"entry":"identifier","kind":"example","input":"PD 5730","expect":{"publisher":"PD","number":"5730"}},{"entry":"identifier","kind":"example","input":"PAS 003:1994","expect":{"publisher":"PAS","number":"003","year":"1994"}},{"entry":"identifier","kind":"example","input":"DD 136-2:1986","expect":{"publisher":"DD","number":"136","part":"2","year":"1986"}},{"entry":"identifier","kind":"example","input":"TS 1:1995","expect":{"publisher":"TS","number":"1","year":"1995"}},{"entry":"identifier","kind":"example","input":"BS EN 1073-2:2002","expect":{"publisher":"BS","adopted":"EN 1073-2:2002"}},{"entry":"identifier","kind":"example","input":"BS EN ISO 105-B06:2020","expect":{"publisher":"BS","adopted":"EN ISO 105-B06:2020"}},{"entry":"identifier","kind":"example","input":"BS EN IEC 61851-1:2019","expect":{"publisher":"BS","adopted":"EN IEC 61851-1:2019"}},{"entry":"identifier","kind":"example","input":"BS ISO 8601:2019","expect":{"publisher":"BS","adopted":"ISO 8601:2019"}},{"entry":"identifier","kind":"example","input":"BS IEC 60747-8:2000","expect":{"publisher":"BS","adopted":"IEC 60747-8:2000"}},{"entry":"identifier","kind":"example","input":"BS HD 60269-3","expect":{"publisher":"BS","adopted":"HD 60269-3"}},{"entry":"identifier","kind":"example","input":"DD CEN ISO/TS 12180-1:2007","expect":{"publisher":"DD","adopted":"CEN ISO/TS 12180-1:2007"}},{"entry":"identifier","kind":"example","input":"DD CLC/TS 50131-2-2:2004","expect":{"publisher":"DD","adopted":"CLC/TS 50131-2-2:2004"}},{"entry":"identifier","kind":"example","input":"BS EN IEC 60601-1/FRAG1","expect":{"publisher":"BS","adopted":"EN IEC 60601-1/FRAG1"}},{"entry":"identifier","kind":"example","input":"BS EN IEC 61535/AMD1/FRAG1","expect":{"publisher":"BS","adopted":"EN IEC 61535/AMD1/FRAG1"}},{"entry":"identifier","kind":"example","input":"BS 10125:2014+A1:2016","expect":{"publisher":"BS","number":"10125","year":"2014"}},{"entry":"identifier","kind":"example","input":"BS EN 1005-1:2001+A1:2008","expect":{"publisher":"BS","adopted":"EN 1005-1:2001"}},{"entry":"identifier","kind":"example","input":"BS 646:1958+A2:2013","expect":{"publisher":"BS","number":"646","year":"1958"}}],"docs":{},"source":"# PFS-generated grammar — DO NOT EDIT BY HAND.\n# Source: definitions/bsi.pfs (pfs:1) sha256:acb28ac064cf70b7dcaf8ec199cd535f95c201ca348746f9124ce7d080473585\n# Compiler: pubid/grammar/pfs 0.1.0\n# Flavor key: bsi_pfs (grammar PubidBsiPfs)\n# Regenerate: ruby scripts/pfs compile definitions/bsi.pfs --as bsi_pfs\n# Module: iso.inner v1 (sha256:7a088d2a7814...)\n# Module: iec.inner v1 (sha256:b9002f5d106b...)\n# Module: en.overlay v1 (sha256:b92ac2b27544...)\n# Module: national.prefix v1 (sha256:c7aa2f2442e8...)\n# Module: supplements.core v1 (sha256:9fa9656375c7...)\n\ngrammar PubidBsiPfs version \"0.1.0\" edition 2 {\n\n # Grammar fragments: named lexical terms declared under `grammar:`.\n iso_space = \" \"\n iso_colon = \":\"\n iso_dash = \"-\"\n iso_year = 4*digit\n iso_part = 1*digit [\"-\" 1*digit]\n iso_number = 1*(\"0\" %x31-39) as iso_zero_lead *digit [iso_dash iso_part]\n iso_document = \"ISO\" iso_space iso_number [iso_colon iso_year]\n iec_space = \" \"\n iec_colon = \":\"\n iec_dash = \"-\"\n iec_year = 4*digit\n iec_part = 1*digit\n iec_number = ((\"6\" 4*digit / 5*digit / 1*digit)) as iec_number_core [iec_dash iec_part]\n iec_document = \"IEC\" iec_space iec_number [iec_colon iec_year]\n en_space = \" \"\n en_draft = (\"pr\" / \"Fpr\") as en_draft_kind\n en_face = [en_draft] \"EN\"\n en_adoption = en_face en_space iso_document\n supplement_number = 1*digit\n supplement_year = 4*digit\n supplement_month = 2*digit\n digit = %x30-39\n alpha = %x41-5A / %x61-7A\n\n # Fields: one capture rule per declared field; the whole pattern\n # is the capture.\n bsi_publisher = ((\"BS\" / \"PAS\" / \"PD\" / \"DD\" / \"TS\")) as publisher\n bsi_number = (1*(%x30-39) [%x41-5A]) as number\n bsi_part = (1*(digit / alpha) *((\".\" / \"-\") 1*(digit / alpha))) as part\n bsi_year = (4digit) as year\n bsi_adopted = (( ( \"EN\" / \"CEN\" / \"CLC\" / \"HD\" / \"ENV\" / \"ES\" / \"CR\" / \"CWA\" / \"ISO\" / \"IEC\" ) ( *( !(bsi_supplement) ( %x01-09 / %x0B-10FFFF ) ) ) )) as adopted\n\n # Supplement run (compiled from the supplements declaration):\n # each item binds its separator, kind face, ordinal and date\n # columns; the builder folds the run into the declared wrapper\n # classes (the slash run standalone, the plus run consolidated).\n bsi_supplement_number = (1*digit) as supplement_number\n bsi_supplements_year = (4digit) as supplements_year\n bsi_supplement_amendment = {\n (\"/\" as supplements_slash / \"+\" as supplements_plus)\n \"A\" as supplement_kind bsi_supplement_number [\":\" bsi_supplements_year]\n }\n bsi_supplement_corrigendum = {\n (\"/\" as supplements_slash / \"+\" as supplements_plus)\n \"C\" as supplement_kind bsi_supplement_number [\":\" bsi_supplements_year]\n }\n bsi_supplement = ( bsi_supplement_amendment / bsi_supplement_corrigendum ) as supplement\n bsi_supplements = (1*bsi_supplement) as supplements\n\n # Identifier rule: the canonical template first, then the\n # declared alternates (parse-in spellings; they normalize to the\n # canonical render face).\n identifier = ( bsi_publisher \" \" bsi_adopted / bsi_publisher \" \" bsi_number [\"-\" bsi_part] [\":\" bsi_year] ) [bsi_supplements]\n entry identifier: identifier\n\n # Typed model bindings: every bound capture lands on the\n # consumer model's field of the same name.\n bindings identifier {\n publisher -> publisher (string)\n number -> number (string)\n part -> part (string)\n year -> year (string)\n adopted -> adopted (string)\n supplement -> supplements[].supplement (raw)\n }\n\n # REQUIRED examples from the definition — accepts, rejects, and\n # the capture expectations the compiler replayed at compile time.\n test {\n accept \"BS 10005:1995\"\n accept \"BS 1016-107.2:1991\"\n accept \"BS 1344-A1:1960\"\n accept \"PD 5730\"\n accept \"PAS 003:1994\"\n accept \"DD 136-2:1986\"\n accept \"TS 1:1995\"\n accept \"BS EN 1073-2:2002\"\n accept \"BS EN ISO 105-B06:2020\"\n accept \"BS EN IEC 61851-1:2019\"\n accept \"BS ISO 8601:2019\"\n accept \"BS IEC 60747-8:2000\"\n accept \"BS HD 60269-3\"\n accept \"DD CEN ISO/TS 12180-1:2007\"\n accept \"DD CLC/TS 50131-2-2:2004\"\n accept \"BS EN IEC 60601-1/FRAG1\"\n accept \"BS EN IEC 61535/AMD1/FRAG1\"\n accept \"BS 10125:2014+A1:2016\"\n accept \"BS EN 1005-1:2001+A1:2008\"\n accept \"BS 646:1958+A2:2013\"\n reject \"nonsense\"\n reject \"BS\"\n reject \"EN 1325\"\n reject \"ISO 9001:2015\"\n reject \"BS 2X 26:2001\"\n reject \"DISC PD 0005:1995\"\n reject \"BS A 103:2025\"\n reject \"BSI Flex 1886 v2.0:2024-09\"\n reject \"BS 7671 AMD2\"\n reject \"BS 1000[9]:1971\"\n reject \"BS 1580:Parts 1 and 2:1962\"\n reject \"BS CISPR 12:1997\"\n reject \"14/30300822 DC\"\n reject \"NA to BS EN 1996-1-2:2005\"\n reject \"BS 7722:2006 BOOK\"\n reject \"BS 31100:2021 ExComm\"\n reject \"AMD 11015\"\n reject \"BS 1425:Supplement No. 1:1966\"\n reject \"BS 185 Index:1962\"\n reject \"BS 2782-10:Method 1006:1978\"\n reject \"BS 1902-2.3:Addendum No. 1:1976\"\n example \"BS 10005:1995\" { publisher: \"BS\" number: \"10005\" year: \"1995\" }\n example \"BS 1016-107.2:1991\" { publisher: \"BS\" number: \"1016\" part: \"107.2\" year: \"1991\" }\n example \"BS 1344-A1:1960\" { publisher: \"BS\" number: \"1344\" part: \"A1\" year: \"1960\" }\n example \"PD 5730\" { publisher: \"PD\" number: \"5730\" }\n example \"PAS 003:1994\" { publisher: \"PAS\" number: \"003\" year: \"1994\" }\n example \"DD 136-2:1986\" { publisher: \"DD\" number: \"136\" part: \"2\" year: \"1986\" }\n example \"TS 1:1995\" { publisher: \"TS\" number: \"1\" year: \"1995\" }\n example \"BS EN 1073-2:2002\" { publisher: \"BS\" adopted: \"EN 1073-2:2002\" }\n example \"BS EN ISO 105-B06:2020\" { publisher: \"BS\" adopted: \"EN ISO 105-B06:2020\" }\n example \"BS EN IEC 61851-1:2019\" { publisher: \"BS\" adopted: \"EN IEC 61851-1:2019\" }\n example \"BS ISO 8601:2019\" { publisher: \"BS\" adopted: \"ISO 8601:2019\" }\n example \"BS IEC 60747-8:2000\" { publisher: \"BS\" adopted: \"IEC 60747-8:2000\" }\n example \"BS HD 60269-3\" { publisher: \"BS\" adopted: \"HD 60269-3\" }\n example \"DD CEN ISO/TS 12180-1:2007\" { publisher: \"DD\" adopted: \"CEN ISO/TS 12180-1:2007\" }\n example \"DD CLC/TS 50131-2-2:2004\" { publisher: \"DD\" adopted: \"CLC/TS 50131-2-2:2004\" }\n example \"BS EN IEC 60601-1/FRAG1\" { publisher: \"BS\" adopted: \"EN IEC 60601-1/FRAG1\" }\n example \"BS EN IEC 61535/AMD1/FRAG1\" { publisher: \"BS\" adopted: \"EN IEC 61535/AMD1/FRAG1\" }\n example \"BS 10125:2014+A1:2016\" { publisher: \"BS\" number: \"10125\" year: \"2014\" }\n example \"BS EN 1005-1:2001+A1:2008\" { publisher: \"BS\" adopted: \"EN 1005-1:2001\" }\n example \"BS 646:1958+A2:2013\" { publisher: \"BS\" number: \"646\" year: \"1958\" }\n }\n}\n","source_hash":"5a9bd671fb9193d1b1b5b8df1284fe1ecf5fdf40ea2514b5fc10d5c4da3473a3","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:ff4f7c71d1477155a9534c68abb01b36917ce6f7473818342999488a85af2eb5","checksum":"sha256:49113b4674e5a7bf6a07d413a1635d6343fe5af1697c9da7715dac3ff39de5ba","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":61,"tests_failures":0,"self_test":true}}
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidBsiPfs","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":7}},{"Str":{"pattern":"BS"}},{"Str":{"pattern":"PAS"}},{"Str":{"pattern":"PD"}},{"Str":{"pattern":"DD"}},{"Str":{"pattern":"TS"}},{"Alternative":{"atoms":[1,2,3,4,5]}},{"Named":{"name":"publisher","atom":6}},{"Str":{"pattern":" "}},{"Entity":{"atom":66}},{"Str":{"pattern":"EN"}},{"Str":{"pattern":"CEN"}},{"Str":{"pattern":"CLC"}},{"Str":{"pattern":"HD"}},{"Str":{"pattern":"ENV"}},{"Str":{"pattern":"ES"}},{"Str":{"pattern":"CR"}},{"Str":{"pattern":"CWA"}},{"Str":{"pattern":"ISO"}},{"Str":{"pattern":"IEC"}},{"Alternative":{"atoms":[10,11,12,13,14,15,16,17,18,19]}},{"Entity":{"atom":58}},{"Entity":{"atom":42}},{"Str":{"pattern":"/"}},{"Named":{"name":"supplements_slash","atom":23}},{"Str":{"pattern":"+"}},{"Named":{"name":"supplements_plus","atom":25}},{"Alternative":{"atoms":[24,26]}},{"Str":{"pattern":"A"}},{"Named":{"name":"supplement_kind","atom":28}},{"Entity":{"atom":34}},{"Entity":{"atom":32}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":31,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplement_number","atom":33}},{"Str":{"pattern":":"}},{"Entity":{"atom":39}},{"Entity":{"atom":32}},{"Repetition":{"atom":37,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"supplements_year","atom":38}},{"Sequence":{"atoms":[35,36]}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[27,29,30,41]}},{"Entity":{"atom":56}},{"Str":{"pattern":"/"}},{"Named":{"name":"supplements_slash","atom":44}},{"Str":{"pattern":"+"}},{"Named":{"name":"supplements_plus","atom":46}},{"Alternative":{"atoms":[45,47]}},{"Str":{"pattern":"C"}},{"Named":{"name":"supplement_kind","atom":49}},{"Entity":{"atom":34}},{"Str":{"pattern":":"}},{"Entity":{"atom":39}},{"Sequence":{"atoms":[52,53]}},{"Repetition":{"atom":54,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[48,50,51,55]}},{"Alternative":{"atoms":[22,43]}},{"Named":{"name":"supplement","atom":57}},{"Lookahead":{"atom":21,"positive":false}},{"Re":{"pattern":"[\\x01-\\x09]"}},{"Re":{"pattern":"[\\x0b-\\u{10ffff}]"}},{"Alternative":{"atoms":[60,61]}},{"Sequence":{"atoms":[59,62]}},{"Repetition":{"atom":63,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[20,64]}},{"Named":{"name":"adopted","atom":65}},{"Sequence":{"atoms":[0,8,9]}},{"Entity":{"atom":7}},{"Str":{"pattern":" "}},{"Entity":{"atom":76}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":71,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":73,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[72,74]}},{"Named":{"name":"number","atom":75}},{"Str":{"pattern":"-"}},{"Entity":{"atom":96}},{"Entity":{"atom":32}},{"Entity":{"atom":83}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[81,82]}},{"Alternative":{"atoms":[79,80]}},{"Repetition":{"atom":84,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Str":{"pattern":"-"}},{"Alternative":{"atoms":[86,87]}},{"Entity":{"atom":32}},{"Entity":{"atom":83}},{"Alternative":{"atoms":[89,90]}},{"Repetition":{"atom":91,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[88,92]}},{"Repetition":{"atom":93,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[85,94]}},{"Named":{"name":"part","atom":95}},{"Sequence":{"atoms":[77,78]}},{"Repetition":{"atom":97,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":":"}},{"Entity":{"atom":103}},{"Entity":{"atom":32}},{"Repetition":{"atom":101,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":102}},{"Sequence":{"atoms":[99,100]}},{"Repetition":{"atom":104,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[68,69,70,98,105]}},{"Alternative":{"atoms":[67,106]}},{"Entity":{"atom":111}},{"Entity":{"atom":58}},{"Repetition":{"atom":109,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"supplements","atom":110}},{"Repetition":{"atom":108,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[107,112]}}],"root":113},"bindings":[{"capture":"publisher","path":"publisher","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":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"adopted","path":"adopted","type":"string","card":null,"preprocess":null},{"capture":"supplement","path":"supplements[].supplement","type":"raw","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"BS 10005:1995","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 1016-107.2:1991","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 1344-A1:1960","expect":{}},{"entry":"identifier","kind":"accept","input":"PD 5730","expect":{}},{"entry":"identifier","kind":"accept","input":"PAS 003:1994","expect":{}},{"entry":"identifier","kind":"accept","input":"DD 136-2:1986","expect":{}},{"entry":"identifier","kind":"accept","input":"TS 1:1995","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN 1073-2:2002","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN ISO 105-B06:2020","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN IEC 61851-1:2019","expect":{}},{"entry":"identifier","kind":"accept","input":"BS ISO 8601:2019","expect":{}},{"entry":"identifier","kind":"accept","input":"BS IEC 60747-8:2000","expect":{}},{"entry":"identifier","kind":"accept","input":"BS HD 60269-3","expect":{}},{"entry":"identifier","kind":"accept","input":"DD CEN ISO/TS 12180-1:2007","expect":{}},{"entry":"identifier","kind":"accept","input":"DD CLC/TS 50131-2-2:2004","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN IEC 60601-1/FRAG1","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN IEC 61535/AMD1/FRAG1","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 10125:2014+A1:2016","expect":{}},{"entry":"identifier","kind":"accept","input":"BS EN 1005-1:2001+A1:2008","expect":{}},{"entry":"identifier","kind":"accept","input":"BS 646:1958+A2:2013","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"BS","expect":{}},{"entry":"identifier","kind":"reject","input":"EN 1325","expect":{}},{"entry":"identifier","kind":"reject","input":"ISO 9001:2015","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 2X 26:2001","expect":{}},{"entry":"identifier","kind":"reject","input":"DISC PD 0005:1995","expect":{}},{"entry":"identifier","kind":"reject","input":"BS A 103:2025","expect":{}},{"entry":"identifier","kind":"reject","input":"BSI Flex 1886 v2.0:2024-09","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 7671 AMD2","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1000[9]:1971","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1580:Parts 1 and 2:1962","expect":{}},{"entry":"identifier","kind":"reject","input":"BS CISPR 12:1997","expect":{}},{"entry":"identifier","kind":"reject","input":"14/30300822 DC","expect":{}},{"entry":"identifier","kind":"reject","input":"NA to BS EN 1996-1-2:2005","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 7722:2006 BOOK","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 31100:2021 ExComm","expect":{}},{"entry":"identifier","kind":"reject","input":"AMD 11015","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1425:Supplement No. 1:1966","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 185 Index:1962","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 2782-10:Method 1006:1978","expect":{}},{"entry":"identifier","kind":"reject","input":"BS 1902-2.3:Addendum No. 1:1976","expect":{}},{"entry":"identifier","kind":"example","input":"BS 10005:1995","expect":{"publisher":"BS","number":"10005","year":"1995"}},{"entry":"identifier","kind":"example","input":"BS 1016-107.2:1991","expect":{"publisher":"BS","number":"1016","part":"107.2","year":"1991"}},{"entry":"identifier","kind":"example","input":"BS 1344-A1:1960","expect":{"publisher":"BS","number":"1344","part":"A1","year":"1960"}},{"entry":"identifier","kind":"example","input":"PD 5730","expect":{"publisher":"PD","number":"5730"}},{"entry":"identifier","kind":"example","input":"PAS 003:1994","expect":{"publisher":"PAS","number":"003","year":"1994"}},{"entry":"identifier","kind":"example","input":"DD 136-2:1986","expect":{"publisher":"DD","number":"136","part":"2","year":"1986"}},{"entry":"identifier","kind":"example","input":"TS 1:1995","expect":{"publisher":"TS","number":"1","year":"1995"}},{"entry":"identifier","kind":"example","input":"BS EN 1073-2:2002","expect":{"publisher":"BS","adopted":"EN 1073-2:2002"}},{"entry":"identifier","kind":"example","input":"BS EN ISO 105-B06:2020","expect":{"publisher":"BS","adopted":"EN ISO 105-B06:2020"}},{"entry":"identifier","kind":"example","input":"BS EN IEC 61851-1:2019","expect":{"publisher":"BS","adopted":"EN IEC 61851-1:2019"}},{"entry":"identifier","kind":"example","input":"BS ISO 8601:2019","expect":{"publisher":"BS","adopted":"ISO 8601:2019"}},{"entry":"identifier","kind":"example","input":"BS IEC 60747-8:2000","expect":{"publisher":"BS","adopted":"IEC 60747-8:2000"}},{"entry":"identifier","kind":"example","input":"BS HD 60269-3","expect":{"publisher":"BS","adopted":"HD 60269-3"}},{"entry":"identifier","kind":"example","input":"DD CEN ISO/TS 12180-1:2007","expect":{"publisher":"DD","adopted":"CEN ISO/TS 12180-1:2007"}},{"entry":"identifier","kind":"example","input":"DD CLC/TS 50131-2-2:2004","expect":{"publisher":"DD","adopted":"CLC/TS 50131-2-2:2004"}},{"entry":"identifier","kind":"example","input":"BS EN IEC 60601-1/FRAG1","expect":{"publisher":"BS","adopted":"EN IEC 60601-1/FRAG1"}},{"entry":"identifier","kind":"example","input":"BS EN IEC 61535/AMD1/FRAG1","expect":{"publisher":"BS","adopted":"EN IEC 61535/AMD1/FRAG1"}},{"entry":"identifier","kind":"example","input":"BS 10125:2014+A1:2016","expect":{"publisher":"BS","number":"10125","year":"2014"}},{"entry":"identifier","kind":"example","input":"BS EN 1005-1:2001+A1:2008","expect":{"publisher":"BS","adopted":"EN 1005-1:2001"}},{"entry":"identifier","kind":"example","input":"BS 646:1958+A2:2013","expect":{"publisher":"BS","number":"646","year":"1958"}}],"docs":{},"source":"# PFS-generated grammar — DO NOT EDIT BY HAND.\n# Source: definitions/bsi.pfs (pfs:1) sha256:e16c91365a12ffa75c8645ce69774e04f808d85d531b1c2c3c0f75f614197cf8\n# Compiler: pubid/grammar/pfs 0.1.0\n# Flavor key: bsi_pfs (grammar PubidBsiPfs)\n# Regenerate: ruby scripts/pfs compile definitions/bsi.pfs --as bsi_pfs\n# Module: iso.inner v1 (sha256:7a088d2a7814...)\n# Module: iec.inner v1 (sha256:b9002f5d106b...)\n# Module: en.overlay v1 (sha256:b92ac2b27544...)\n# Module: national.prefix v1 (sha256:c7aa2f2442e8...)\n# Module: supplements.core v1 (sha256:9fa9656375c7...)\n\ngrammar PubidBsiPfs version \"0.1.0\" edition 2 {\n\n # Grammar fragments: named lexical terms declared under `grammar:`.\n iso_space = \" \"\n iso_colon = \":\"\n iso_dash = \"-\"\n iso_year = 4*digit\n iso_part = 1*digit [\"-\" 1*digit]\n iso_number = 1*(\"0\" %x31-39) as iso_zero_lead *digit [iso_dash iso_part]\n iso_document = \"ISO\" iso_space iso_number [iso_colon iso_year]\n iec_space = \" \"\n iec_colon = \":\"\n iec_dash = \"-\"\n iec_year = 4*digit\n iec_part = 1*digit\n iec_number = ((\"6\" 4*digit / 5*digit / 1*digit)) as iec_number_core [iec_dash iec_part]\n iec_document = \"IEC\" iec_space iec_number [iec_colon iec_year]\n en_space = \" \"\n en_draft = (\"pr\" / \"Fpr\") as en_draft_kind\n en_face = [en_draft] \"EN\"\n en_adoption = en_face en_space iso_document\n supplement_number = 1*digit\n supplement_year = 4*digit\n supplement_month = 2*digit\n digit = %x30-39\n alpha = %x41-5A / %x61-7A\n\n # Fields: one capture rule per declared field; the whole pattern\n # is the capture.\n bsi_publisher = ((\"BS\" / \"PAS\" / \"PD\" / \"DD\" / \"TS\")) as publisher\n bsi_number = (1*(%x30-39) [%x41-5A]) as number\n bsi_part = (1*(digit / alpha) *((\".\" / \"-\") 1*(digit / alpha))) as part\n bsi_year = (4digit) as year\n bsi_adopted = (( ( \"EN\" / \"CEN\" / \"CLC\" / \"HD\" / \"ENV\" / \"ES\" / \"CR\" / \"CWA\" / \"ISO\" / \"IEC\" ) ( *( !(bsi_supplement) ( %x01-09 / %x0B-10FFFF ) ) ) )) as adopted\n\n # Supplement run (compiled from the supplements declaration):\n # each item binds its separator, kind face, ordinal and date\n # columns; the builder folds the run into the declared wrapper\n # classes (the slash run standalone, the plus run consolidated).\n bsi_supplement_number = (1*digit) as supplement_number\n bsi_supplements_year = (4digit) as supplements_year\n bsi_supplement_amendment = {\n (\"/\" as supplements_slash / \"+\" as supplements_plus)\n \"A\" as supplement_kind bsi_supplement_number [\":\" bsi_supplements_year]\n }\n bsi_supplement_corrigendum = {\n (\"/\" as supplements_slash / \"+\" as supplements_plus)\n \"C\" as supplement_kind bsi_supplement_number [\":\" bsi_supplements_year]\n }\n bsi_supplement = ( bsi_supplement_amendment / bsi_supplement_corrigendum ) as supplement\n bsi_supplements = (1*bsi_supplement) as supplements\n\n # Identifier rule: the canonical template first, then the\n # declared alternates (parse-in spellings; they normalize to the\n # canonical render face).\n identifier = ( bsi_publisher \" \" bsi_adopted / bsi_publisher \" \" bsi_number [\"-\" bsi_part] [\":\" bsi_year] ) [bsi_supplements]\n entry identifier: identifier\n\n # Typed model bindings: every bound capture lands on the\n # consumer model's field of the same name.\n bindings identifier {\n publisher -> publisher (string)\n number -> number (string)\n part -> part (string)\n year -> year (string)\n adopted -> adopted (string)\n supplement -> supplements[].supplement (raw)\n }\n\n # REQUIRED examples from the definition — accepts, rejects, and\n # the capture expectations the compiler replayed at compile time.\n test {\n accept \"BS 10005:1995\"\n accept \"BS 1016-107.2:1991\"\n accept \"BS 1344-A1:1960\"\n accept \"PD 5730\"\n accept \"PAS 003:1994\"\n accept \"DD 136-2:1986\"\n accept \"TS 1:1995\"\n accept \"BS EN 1073-2:2002\"\n accept \"BS EN ISO 105-B06:2020\"\n accept \"BS EN IEC 61851-1:2019\"\n accept \"BS ISO 8601:2019\"\n accept \"BS IEC 60747-8:2000\"\n accept \"BS HD 60269-3\"\n accept \"DD CEN ISO/TS 12180-1:2007\"\n accept \"DD CLC/TS 50131-2-2:2004\"\n accept \"BS EN IEC 60601-1/FRAG1\"\n accept \"BS EN IEC 61535/AMD1/FRAG1\"\n accept \"BS 10125:2014+A1:2016\"\n accept \"BS EN 1005-1:2001+A1:2008\"\n accept \"BS 646:1958+A2:2013\"\n reject \"nonsense\"\n reject \"BS\"\n reject \"EN 1325\"\n reject \"ISO 9001:2015\"\n reject \"BS 2X 26:2001\"\n reject \"DISC PD 0005:1995\"\n reject \"BS A 103:2025\"\n reject \"BSI Flex 1886 v2.0:2024-09\"\n reject \"BS 7671 AMD2\"\n reject \"BS 1000[9]:1971\"\n reject \"BS 1580:Parts 1 and 2:1962\"\n reject \"BS CISPR 12:1997\"\n reject \"14/30300822 DC\"\n reject \"NA to BS EN 1996-1-2:2005\"\n reject \"BS 7722:2006 BOOK\"\n reject \"BS 31100:2021 ExComm\"\n reject \"AMD 11015\"\n reject \"BS 1425:Supplement No. 1:1966\"\n reject \"BS 185 Index:1962\"\n reject \"BS 2782-10:Method 1006:1978\"\n reject \"BS 1902-2.3:Addendum No. 1:1976\"\n example \"BS 10005:1995\" { publisher: \"BS\" number: \"10005\" year: \"1995\" }\n example \"BS 1016-107.2:1991\" { publisher: \"BS\" number: \"1016\" part: \"107.2\" year: \"1991\" }\n example \"BS 1344-A1:1960\" { publisher: \"BS\" number: \"1344\" part: \"A1\" year: \"1960\" }\n example \"PD 5730\" { publisher: \"PD\" number: \"5730\" }\n example \"PAS 003:1994\" { publisher: \"PAS\" number: \"003\" year: \"1994\" }\n example \"DD 136-2:1986\" { publisher: \"DD\" number: \"136\" part: \"2\" year: \"1986\" }\n example \"TS 1:1995\" { publisher: \"TS\" number: \"1\" year: \"1995\" }\n example \"BS EN 1073-2:2002\" { publisher: \"BS\" adopted: \"EN 1073-2:2002\" }\n example \"BS EN ISO 105-B06:2020\" { publisher: \"BS\" adopted: \"EN ISO 105-B06:2020\" }\n example \"BS EN IEC 61851-1:2019\" { publisher: \"BS\" adopted: \"EN IEC 61851-1:2019\" }\n example \"BS ISO 8601:2019\" { publisher: \"BS\" adopted: \"ISO 8601:2019\" }\n example \"BS IEC 60747-8:2000\" { publisher: \"BS\" adopted: \"IEC 60747-8:2000\" }\n example \"BS HD 60269-3\" { publisher: \"BS\" adopted: \"HD 60269-3\" }\n example \"DD CEN ISO/TS 12180-1:2007\" { publisher: \"DD\" adopted: \"CEN ISO/TS 12180-1:2007\" }\n example \"DD CLC/TS 50131-2-2:2004\" { publisher: \"DD\" adopted: \"CLC/TS 50131-2-2:2004\" }\n example \"BS EN IEC 60601-1/FRAG1\" { publisher: \"BS\" adopted: \"EN IEC 60601-1/FRAG1\" }\n example \"BS EN IEC 61535/AMD1/FRAG1\" { publisher: \"BS\" adopted: \"EN IEC 61535/AMD1/FRAG1\" }\n example \"BS 10125:2014+A1:2016\" { publisher: \"BS\" number: \"10125\" year: \"2014\" }\n example \"BS EN 1005-1:2001+A1:2008\" { publisher: \"BS\" adopted: \"EN 1005-1:2001\" }\n example \"BS 646:1958+A2:2013\" { publisher: \"BS\" number: \"646\" year: \"1958\" }\n }\n}\n","source_hash":"83631d43804920c9ef782eee3731a411bd60bc8dd63a4e5248be6f9a87fb01cd","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:f327b757c2ee8eede07056ba3f564caa81ea3332f9913285c86ca22001c46d06","checksum":"sha256:71f1a18a597a6601bf1b454514dcda1cfa40a2cb63506976d03082730bf559ae","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":61,"tests_failures":0,"self_test":true}}
@@ -1 +1 @@
1
- {"bindings":null,"version":"1.0.0","grammar":"Csv","shape":"parsanol-tree/v2","binding_version":1,"entries":{"main":{"root":"file","grammar":{"atoms":[{"Entity":{"atom":28}},{"Entity":{"atom":21}},{"Entity":{"atom":13}},{"Entity":{"atom":4}},{"Re":{"pattern":"[\"]"}},{"Re":{"pattern":"[\\x00-\\x21]"}},{"Re":{"pattern":"[\\x23-\\u{10ffff}]"}},{"Entity":{"atom":4}},{"Entity":{"atom":4}},{"Sequence":{"atoms":[7,8]}},{"Alternative":{"atoms":[5,6,9]}},{"Repetition":{"atom":10,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":4}},{"Sequence":{"atoms":[3,11,12]}},{"Entity":{"atom":19}},{"Re":{"pattern":"[ !]"}},{"Re":{"pattern":"[\\x23-\\x2b]"}},{"Re":{"pattern":"[\\x2d-\\u{10ffff}]"}},{"Alternative":{"atoms":[15,16,17]}},{"Repetition":{"atom":18,"min":0,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[2,14]}},{"Named":{"name":"field","atom":20}},{"Entity":{"atom":23}},{"Re":{"pattern":"[,]"}},{"Entity":{"atom":21}},{"Sequence":{"atoms":[22,24]}},{"Repetition":{"atom":25,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[1,26]}},{"Named":{"name":"record","atom":27}},{"Entity":{"atom":36}},{"Entity":{"atom":33}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[31,32]}},{"Entity":{"atom":35}},{"Re":{"pattern":"[\\x0a]"}},{"Alternative":{"atoms":[30,34]}},{"Entity":{"atom":28}},{"Sequence":{"atoms":[29,37]}},{"Repetition":{"atom":38,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":36}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,39,41]}}],"root":42},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"main","render":{},"derive":{},"tests":[{"entry":"main","kind":"accept","input":"a,b,c","expect":{}},{"entry":"main","kind":"accept","input":"1,2\r\n3,4","expect":{}},{"entry":"main","kind":"accept","input":"1,2\n3,4","expect":{}},{"entry":"main","kind":"accept","input":"\"quoted,comma\",plain","expect":{}},{"entry":"main","kind":"accept","input":"\"say \"\"hi\"\"\",x","expect":{}},{"entry":"main","kind":"accept","input":"single","expect":{}},{"entry":"main","kind":"accept","input":"a,b,\r\n,,c","expect":{}},{"entry":"main","kind":"accept","input":"name,age\n\"Smith, John\",42\n\"multi\nline\",1","expect":{}},{"entry":"main","kind":"accept","input":"\"unicode ünïcödé\",2","expect":{}},{"entry":"main","kind":"accept","input":"row with trailing newline\n","expect":{}},{"entry":"main","kind":"accept","input":"a,b,\n","expect":{}},{"entry":"main","kind":"reject","input":"\"unterminated,x","expect":{}},{"entry":"main","kind":"reject","input":"a,\"mix\"ed","expect":{}},{"entry":"main","kind":"reject","input":"a,,b\rc","expect":{}},{"entry":"main","kind":"reject","input":"a\tb,c","expect":{}}],"docs":{"file":"file = record *( eol record ) [ eol ]; one record minimum (an\nempty document parses as one empty unquoted field).","eol":"eol: the RFC wire form is CRLF; bare LF tolerated.","quoted_field":"Quoted: dquote, any non-dquote bytes (CR/LF included — RFC allows\nline breaks inside quoted fields), or a doubled dquote escape.","unquoted_field":"Unquoted: RFC textdata (no dquote, comma, CR, LF) extended for\nmultibyte."},"source":"# CSV (RFC 4180): the delimited-data grammar — the second\n# general-purpose data-format flavor, riding the json flavor's\n# methodology (parsanol-rs#531 grammar breadth).\n#\n# Edition-2 notes: records are right-recursive through the row list\n# (no left recursion). Quoted fields admit any byte except a raw\n# dquote (dquotes double per RFC 4180 section 2.7); line breaks inside\n# quotes are legal RFC — the quoted class includes them. Unquoted\n# fields exclude dquote/comma/CR/LF (textdata, extended past 0x7E to\n# 0x10FFFF for UTF-8 content). Bare LF is accepted alongside CRLF\n# (editors rewrite line endings); a trailing row terminator is\n# optional. A trailing comma is a reject (RFC-strict: every comma\n# opens another field).\n\ngrammar Csv version \"1.0.0\" edition 2 {\n crlf = %x0D %x0A\n lf = %x0A\n comma = %x2C\n dquote = %x22\n\n ## file = record *( eol record ) [ eol ]; one record minimum (an\n ## empty document parses as one empty unquoted field).\n file = csv_record *( eol csv_record ) [ eol ]\n\n ## eol: the RFC wire form is CRLF; bare LF tolerated.\n eol = crlf / lf\n\n csv_record = ( field *( comma field ) ) as record\n field = ( quoted_field / unquoted_field ) as field\n\n ## Quoted: dquote, any non-dquote bytes (CR/LF included — RFC allows\n ## line breaks inside quoted fields), or a doubled dquote escape.\n quoted_field = dquote *( %x00-21 / %x23-10FFFF / dquote dquote ) dquote\n\n ## Unquoted: RFC textdata (no dquote, comma, CR, LF) extended for\n ## multibyte.\n unquoted_field = *( %x20-21 / %x23-2B / %x2D-10FFFF )\n\n entry main: file\n\n test {\n accept \"a,b,c\"\n accept \"1,2\\r\\n3,4\"\n accept \"1,2\\n3,4\"\n accept \"\\\"quoted,comma\\\",plain\"\n accept \"\\\"say \\\"\\\"hi\\\"\\\"\\\",x\"\n accept \"single\"\n accept \"a,b,\\r\\n,,c\"\n accept \"name,age\\n\\\"Smith, John\\\",42\\n\\\"multi\\nline\\\",1\"\n accept \"\\\"unicode ünïcödé\\\",2\"\n accept \"row with trailing newline\\n\"\n accept \"a,b,\\n\"\n reject \"\\\"unterminated,x\"\n reject \"a,\\\"mix\\\"ed\"\n reject \"a,,b\\rc\"\n reject \"a\\tb,c\"\n }\n}\n","source_hash":"bbdc83bc10785729575a5737a2215484e977ceccd21b0e93f0b462dbd4ad8583","unicode_tables":"onigmo (Ruby 4.0.7)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:66c57d7cd076087d38a0f19eca7edb55f02ea90eeb77fe5fc7ced17ce65f7fca","checksum":"sha256:1fed5647afa46302b8f3e7de5b6ddd24224a91cb3bbb20e9637193b94ff1e62b","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":15,"tests_failures":0,"self_test":true}}
1
+ {"bindings":null,"version":"1.0.0","grammar":"Csv","shape":"parsanol-tree/v2","binding_version":1,"entries":{"main":{"root":"file","grammar":{"atoms":[{"Entity":{"atom":28}},{"Entity":{"atom":21}},{"Entity":{"atom":13}},{"Entity":{"atom":4}},{"Re":{"pattern":"[\"]"}},{"Re":{"pattern":"[\\x00-\\x21]"}},{"Re":{"pattern":"[\\x23-\\u{10ffff}]"}},{"Entity":{"atom":4}},{"Entity":{"atom":4}},{"Sequence":{"atoms":[7,8]}},{"Alternative":{"atoms":[5,6,9]}},{"Repetition":{"atom":10,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":4}},{"Sequence":{"atoms":[3,11,12]}},{"Entity":{"atom":19}},{"Re":{"pattern":"[ !]"}},{"Re":{"pattern":"[\\x23-\\x2b]"}},{"Re":{"pattern":"[\\x2d-\\u{10ffff}]"}},{"Alternative":{"atoms":[15,16,17]}},{"Repetition":{"atom":18,"min":0,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[2,14]}},{"Named":{"name":"field","atom":20}},{"Entity":{"atom":23}},{"Re":{"pattern":"[,]"}},{"Entity":{"atom":21}},{"Sequence":{"atoms":[22,24]}},{"Repetition":{"atom":25,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[1,26]}},{"Named":{"name":"record","atom":27}},{"Entity":{"atom":36}},{"Entity":{"atom":33}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[31,32]}},{"Entity":{"atom":35}},{"Re":{"pattern":"[\\x0a]"}},{"Alternative":{"atoms":[30,34]}},{"Entity":{"atom":28}},{"Sequence":{"atoms":[29,37]}},{"Repetition":{"atom":38,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":36}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[0,39,41]}}],"root":42},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"main","render":{},"derive":{},"tests":[{"entry":"main","kind":"accept","input":"a,b,c","expect":{}},{"entry":"main","kind":"accept","input":"1,2\r\n3,4","expect":{}},{"entry":"main","kind":"accept","input":"1,2\n3,4","expect":{}},{"entry":"main","kind":"accept","input":"\"quoted,comma\",plain","expect":{}},{"entry":"main","kind":"accept","input":"\"say \"\"hi\"\"\",x","expect":{}},{"entry":"main","kind":"accept","input":"single","expect":{}},{"entry":"main","kind":"accept","input":"a,b,\r\n,,c","expect":{}},{"entry":"main","kind":"accept","input":"name,age\n\"Smith, John\",42\n\"multi\nline\",1","expect":{}},{"entry":"main","kind":"accept","input":"\"unicode ünïcödé\",2","expect":{}},{"entry":"main","kind":"accept","input":"row with trailing newline\n","expect":{}},{"entry":"main","kind":"accept","input":"a,b,\n","expect":{}},{"entry":"main","kind":"reject","input":"\"unterminated,x","expect":{}},{"entry":"main","kind":"reject","input":"a,\"mix\"ed","expect":{}},{"entry":"main","kind":"reject","input":"a,,b\rc","expect":{}},{"entry":"main","kind":"reject","input":"a\tb,c","expect":{}}],"docs":{"file":"file = record *( eol record ) [ eol ]; one record minimum (an\nempty document parses as one empty unquoted field).","eol":"eol: the RFC wire form is CRLF; bare LF tolerated.","quoted_field":"Quoted: dquote, any non-dquote bytes (CR/LF included — RFC allows\nline breaks inside quoted fields), or a doubled dquote escape.","unquoted_field":"Unquoted: RFC textdata (no dquote, comma, CR, LF) extended for\nmultibyte."},"source":"# CSV (RFC 4180): the delimited-data grammar — the second\n# general-purpose data-format flavor, riding the json flavor's\n# methodology (parsanol-rs#531 grammar breadth).\n#\n# Edition-2 notes: records are right-recursive through the row list\n# (no left recursion). Quoted fields admit any byte except a raw\n# dquote (dquotes double per RFC 4180 section 2.7); line breaks inside\n# quotes are legal RFC — the quoted class includes them. Unquoted\n# fields exclude dquote/comma/CR/LF (textdata, extended past 0x7E to\n# 0x10FFFF for UTF-8 content). Bare LF is accepted alongside CRLF\n# (editors rewrite line endings); a trailing row terminator is\n# optional. A trailing comma is a reject (RFC-strict: every comma\n# opens another field).\n\ngrammar Csv version \"1.0.0\" edition 2 {\n crlf = %x0D %x0A\n lf = %x0A\n comma = %x2C\n dquote = %x22\n\n ## file = record *( eol record ) [ eol ]; one record minimum (an\n ## empty document parses as one empty unquoted field).\n file = csv_record *( eol csv_record ) [ eol ]\n\n ## eol: the RFC wire form is CRLF; bare LF tolerated.\n eol = crlf / lf\n\n csv_record = ( field *( comma field ) ) as record\n field = ( quoted_field / unquoted_field ) as field\n\n ## Quoted: dquote, any non-dquote bytes (CR/LF included — RFC allows\n ## line breaks inside quoted fields), or a doubled dquote escape.\n quoted_field = dquote *( %x00-21 / %x23-10FFFF / dquote dquote ) dquote\n\n ## Unquoted: RFC textdata (no dquote, comma, CR, LF) extended for\n ## multibyte.\n unquoted_field = *( %x20-21 / %x23-2B / %x2D-10FFFF )\n\n entry main: file\n\n test {\n accept \"a,b,c\"\n accept \"1,2\\r\\n3,4\"\n accept \"1,2\\n3,4\"\n accept \"\\\"quoted,comma\\\",plain\"\n accept \"\\\"say \\\"\\\"hi\\\"\\\"\\\",x\"\n accept \"single\"\n accept \"a,b,\\r\\n,,c\"\n accept \"name,age\\n\\\"Smith, John\\\",42\\n\\\"multi\\nline\\\",1\"\n accept \"\\\"unicode ünïcödé\\\",2\"\n accept \"row with trailing newline\\n\"\n accept \"a,b,\\n\"\n reject \"\\\"unterminated,x\"\n reject \"a,\\\"mix\\\"ed\"\n reject \"a,,b\\rc\"\n reject \"a\\tb,c\"\n }\n}\n","source_hash":"bbdc83bc10785729575a5737a2215484e977ceccd21b0e93f0b462dbd4ad8583","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:66c57d7cd076087d38a0f19eca7edb55f02ea90eeb77fe5fc7ced17ce65f7fca","checksum":"sha256:33215bd625fe7e9a81aab93ebcb3e57c36b2305b0c2899a40f79daa97b4c9ea9","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":15,"tests_failures":0,"self_test":true}}
@@ -0,0 +1 @@
1
+ {"bindings":null,"version":"0.1.0","grammar":"PubidEu","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":24}},{"Str":{"pattern":"EU"}},{"Named":{"name":"prefix","atom":1}},{"Str":{"pattern":" "}},{"Entity":{"atom":9}},{"Str":{"pattern":"Regulation"}},{"Str":{"pattern":"Directive"}},{"Str":{"pattern":"Decision"}},{"Alternative":{"atoms":[5,6,7]}},{"Named":{"name":"type_word","atom":8}},{"Str":{"pattern":" No"}},{"Named":{"name":"no","atom":10}},{"Repetition":{"atom":11,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":18}},{"Entity":{"atom":16}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":15,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"first","atom":17}},{"Str":{"pattern":"/"}},{"Entity":{"atom":23}},{"Entity":{"atom":16}},{"Repetition":{"atom":21,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"second","atom":22}},{"Sequence":{"atoms":[2,3,4,12,13,14,19,20]}},{"Entity":{"atom":57}},{"Entity":{"atom":9}},{"Str":{"pattern":" ("}},{"Entity":{"atom":35}},{"Str":{"pattern":"Euratom"}},{"Str":{"pattern":"CFSP"}},{"Str":{"pattern":"EEC"}},{"Str":{"pattern":"EC"}},{"Str":{"pattern":"EU"}},{"Alternative":{"atoms":[29,30,31,32,33]}},{"Named":{"name":"family","atom":34}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[27,28,36]}},{"Repetition":{"atom":37,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" No"}},{"Named":{"name":"no","atom":39}},{"Repetition":{"atom":40,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":" "}},{"Entity":{"atom":18}},{"Str":{"pattern":"/"}},{"Entity":{"atom":23}},{"Str":{"pattern":"/"}},{"Entity":{"atom":54}},{"Str":{"pattern":"Euratom"}},{"Str":{"pattern":"CFSP"}},{"Str":{"pattern":"EEC"}},{"Str":{"pattern":"EC"}},{"Str":{"pattern":"EU"}},{"Alternative":{"atoms":[48,49,50,51,52]}},{"Named":{"name":"family_suffix","atom":53}},{"Sequence":{"atoms":[46,47]}},{"Repetition":{"atom":55,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[26,38,41,42,43,44,45,56]}},{"Entity":{"atom":79}},{"Str":{"pattern":"CELEX"}},{"Str":{"pattern":" "}},{"Str":{"pattern":": "}},{"Str":{"pattern":":"}},{"Alternative":{"atoms":[60,61,62]}},{"Sequence":{"atoms":[59,63]}},{"Repetition":{"atom":64,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"3"}},{"Entity":{"atom":16}},{"Repetition":{"atom":67,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":68}},{"Entity":{"atom":75}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"D"}},{"Alternative":{"atoms":[71,72,73]}},{"Named":{"name":"celex_letter","atom":74}},{"Entity":{"atom":16}},{"Repetition":{"atom":76,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":77}},{"Sequence":{"atoms":[65,66,69,70,78]}},{"Entity":{"atom":101}},{"Str":{"pattern":"http"}},{"Str":{"pattern":"s"}},{"Repetition":{"atom":82,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"://data.europa.eu/eli/"}},{"Entity":{"atom":90}},{"Str":{"pattern":"reg"}},{"Str":{"pattern":"dir"}},{"Str":{"pattern":"dec"}},{"Alternative":{"atoms":[86,87,88]}},{"Named":{"name":"eli_type","atom":89}},{"Str":{"pattern":"/"}},{"Entity":{"atom":16}},{"Repetition":{"atom":92,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":93}},{"Str":{"pattern":"/"}},{"Entity":{"atom":16}},{"Repetition":{"atom":96,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":97}},{"Str":{"pattern":"/oj"}},{"Repetition":{"atom":99,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[81,83,84,85,91,94,95,98,100]}},{"Alternative":{"atoms":[0,25,58,80]}}],"root":102},"bindings":[{"capture":"prefix","path":"prefix","type":"string","card":null,"preprocess":null},{"capture":"type_word","path":"type_word","type":"string","card":null,"preprocess":null},{"capture":"family","path":"family","type":"string","card":null,"preprocess":null},{"capture":"family_suffix","path":"family_suffix","type":"string","card":null,"preprocess":null},{"capture":"no","path":"no","type":"string","card":null,"preprocess":null},{"capture":"first","path":"first","type":"string","card":null,"preprocess":null},{"capture":"second","path":"second","type":"string","card":null,"preprocess":null},{"capture":"celex_letter","path":"celex_letter","type":"string","card":null,"preprocess":null},{"capture":"eli_type","path":"eli_type","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":[]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"EU Regulation 1227/2011","expect":{}},{"entry":"identifier","kind":"accept","input":"EU Directive 2016/680","expect":{}},{"entry":"identifier","kind":"accept","input":"Regulation (EU) No 1227/2011","expect":{}},{"entry":"identifier","kind":"accept","input":"Directive 2010/75/EU","expect":{}},{"entry":"identifier","kind":"accept","input":"CELEX 32011R1227","expect":{}},{"entry":"identifier","kind":"accept","input":"CELEX: 32011R1227","expect":{}},{"entry":"identifier","kind":"accept","input":"EU Regulation No 2015/2014","expect":{}},{"entry":"identifier","kind":"accept","input":"32016L0680","expect":{}},{"entry":"identifier","kind":"accept","input":"http://data.europa.eu/eli/reg/2011/1227/oj","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"EU Regulation 1227","expect":{}},{"entry":"identifier","kind":"example","input":"EU Regulation 1227/2011","expect":{"prefix":"EU","type_word":"Regulation","first":"1227","second":"2011"}},{"entry":"identifier","kind":"example","input":"Regulation (EU) No 1227/2011","expect":{"type_word":"Regulation","family":"EU","no":" No","first":"1227","second":"2011"}},{"entry":"identifier","kind":"example","input":"Directive 2010/75/EU","expect":{"type_word":"Directive","first":"2010","second":"75","family_suffix":"EU"}},{"entry":"identifier","kind":"example","input":"EU Regulation No 2015/2014","expect":{"prefix":"EU","type_word":"Regulation","no":" No","first":"2015","second":"2014"}},{"entry":"identifier","kind":"example","input":"CELEX 32016R0679","expect":{"year":"2016","celex_letter":"R","number":"0679"}},{"entry":"identifier","kind":"example","input":"http://data.europa.eu/eli/dir/2016/680/oj","expect":{"eli_type":"dir","year":"2016","number":"680"}}],"docs":{},"source":"# EU legal acts (Regulation / Directive / Decision), four input forms:\n# canonical EU Regulation 1227/2011, EU Directive 2016/680\n# long (OJ) Regulation (EU) No 1227/2011, Directive 2010/75/EU\n# CELEX CELEX 32011R1227, CELEX:32011R1227, 32011R1227\n# ELI http://data.europa.eu/eli/reg/2011/1227/oj\n# The canonical and long forms capture the two numbers as `first` and\n# `second`: which one is the year is not derivable from the grammar\n# (`Regulation (EC) No 2003/2003`), so the Ruby builder decides; an\n# optional `No` (also in the canonical form, where the renderer prints it\n# only to tell two readings apart) marks <number>/<year>. CELEX and ELI fix\n# the order, so they capture `year` and `number` directly. The bracketed\n# and the suffixed family are separate captures, so the builder can reject\n# a conflict (`Regulation (EU) No 1227/2011/EC`).\n\ngrammar PubidEu version \"0.1.0\" edition 2 {\n digit = %x30-39\n type_word = (\"Regulation\" / \"Directive\" / \"Decision\") as type_word\n family = (\"Euratom\" / \"CFSP\" / \"EEC\" / \"EC\" / \"EU\") as family\n family_suffix = (\"Euratom\" / \"CFSP\" / \"EEC\" / \"EC\" / \"EU\") as family_suffix\n first = (1*digit) as first\n second = (1*digit) as second\n canonical = (\"EU\") as prefix \" \" type_word [(\" No\") as no] \" \" first \"/\" second\n long = type_word [\" (\" family \")\"] [(\" No\") as no] \" \" first \"/\" second [\"/\" family_suffix]\n celex_letter = (\"R\" / \"L\" / \"D\") as celex_letter\n celex = [\"CELEX\" (\" \" / \": \" / \":\")] \"3\" (4digit) as year celex_letter (1*digit) as number\n eli_type = (\"reg\" / \"dir\" / \"dec\") as eli_type\n eli = \"http\" [\"s\"] \"://data.europa.eu/eli/\" eli_type \"/\" (4digit) as year \"/\" (1*digit) as number [\"/oj\"]\n identifier = canonical / long / celex / eli\n entry identifier: identifier\n\n bindings identifier {\n prefix -> prefix (string)\n type_word -> type_word (string)\n family -> family (string)\n family_suffix -> family_suffix (string)\n no -> no (string)\n first -> first (string)\n second -> second (string)\n celex_letter -> celex_letter (string)\n eli_type -> eli_type (string)\n year -> year (string)\n number -> number (string)\n }\n\n test {\n accept \"EU Regulation 1227/2011\"\n accept \"EU Directive 2016/680\"\n accept \"Regulation (EU) No 1227/2011\"\n accept \"Directive 2010/75/EU\"\n accept \"CELEX 32011R1227\"\n accept \"CELEX: 32011R1227\"\n accept \"EU Regulation No 2015/2014\"\n accept \"32016L0680\"\n accept \"http://data.europa.eu/eli/reg/2011/1227/oj\"\n reject \"nonsense\"\n reject \"EU Regulation 1227\"\n example \"EU Regulation 1227/2011\" { prefix: \"EU\", type_word: \"Regulation\", first: \"1227\", second: \"2011\" }\n example \"Regulation (EU) No 1227/2011\" { type_word: \"Regulation\", family: \"EU\", no: \" No\", first: \"1227\", second: \"2011\" }\n example \"Directive 2010/75/EU\" { type_word: \"Directive\", first: \"2010\", second: \"75\", family_suffix: \"EU\" }\n example \"EU Regulation No 2015/2014\" { prefix: \"EU\", type_word: \"Regulation\", no: \" No\", first: \"2015\", second: \"2014\" }\n example \"CELEX 32016R0679\" { year: \"2016\", celex_letter: \"R\", number: \"0679\" }\n example \"http://data.europa.eu/eli/dir/2016/680/oj\" { eli_type: \"dir\", year: \"2016\", number: \"680\" }\n }\n}\n","source_hash":"5adb915dde94053a07f7e50e1e24395f39e22cbed6edc0214dfb4254decb5873","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:c2fc5391cb50af1cdfff0a2eef224997807fab2f72e8dfddbd09ca9ed5a547b5","checksum":"sha256:61e9aa6cae956dd9082e46d3129fd886eb78d5664491f1b6864c4cc1e729ff40","validated":{"lint_errors":0,"lint_warnings":0,"tests_total":17,"tests_failures":0,"self_test":true}}
@@ -1 +1 @@
1
- {"bindings":null,"version":"1.0.0","grammar":"Ini","shape":"parsanol-tree/v2","binding_version":1,"entries":{"main":{"root":"ini","grammar":{"atoms":[{"Entity":{"atom":15}},{"Entity":{"atom":5}},{"Re":{"pattern":"[ ]"}},{"Re":{"pattern":"[\\x09]"}},{"Alternative":{"atoms":[2,3]}},{"Repetition":{"atom":4,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":13}},{"Entity":{"atom":10}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[8,9]}},{"Entity":{"atom":12}},{"Re":{"pattern":"[\\x0a]"}},{"Alternative":{"atoms":[7,11]}},{"Sequence":{"atoms":[1,6]}},{"Named":{"name":"blank","atom":14}},{"Entity":{"atom":27}},{"Entity":{"atom":5}},{"Entity":{"atom":21}},{"Re":{"pattern":"[;]"}},{"Re":{"pattern":"[#]"}},{"Alternative":{"atoms":[19,20]}},{"Re":{"pattern":"[\\x20-\\u{10ffff}]"}},{"Repetition":{"atom":22,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":13}},{"Repetition":{"atom":24,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[17,18,23,25]}},{"Named":{"name":"comment","atom":26}},{"Entity":{"atom":49}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\[]"}},{"Entity":{"atom":5}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Re":{"pattern":"[\\x20-\\x22]"}},{"Re":{"pattern":"[\\x24-\\x39]"}},{"Re":{"pattern":"[<]"}},{"Re":{"pattern":"[\\x3e-\\x5a]"}},{"Re":{"pattern":"[\\\\]"}},{"Re":{"pattern":"[\\x5e-\\u{10ffff}]"}},{"Alternative":{"atoms":[34,35,36,37,38,39]}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"name","atom":41}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\]]"}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[29,30,31,32,43,44,45,47]}},{"Named":{"name":"section","atom":48}},{"Entity":{"atom":69}},{"Entity":{"atom":5}},{"Entity":{"atom":55}},{"Entity":{"atom":40}},{"Repetition":{"atom":53,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"key","atom":54}},{"Entity":{"atom":5}},{"Entity":{"atom":64}},{"Re":{"pattern":"[=]"}},{"Re":{"pattern":"[:]"}},{"Alternative":{"atoms":[58,59]}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x20-\\u{10ffff}]"}},{"Repetition":{"atom":62,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[60,61,63]}},{"Repetition":{"atom":57,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":13}},{"Repetition":{"atom":66,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[51,52,56,65,67]}},{"Named":{"name":"setting","atom":68}},{"Alternative":{"atoms":[0,16,28,50]}},{"Repetition":{"atom":70,"min":0,"max":null,"tag":"Repetition"}}],"root":71},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule name_char: branches 1 and 6 are order-dependent (first set not statically known)","rule name_char: branches 2 and 6 are order-dependent (first set not statically known)","rule name_char: branches 3 and 6 are order-dependent (first set not statically known)","rule name_char: branches 4 and 6 are order-dependent (first set not statically known)","rule name_char: branches 5 and 6 are order-dependent (first set not statically known)"]},"default_entry":"main","render":{},"derive":{},"tests":[{"entry":"main","kind":"accept","input":"[section]\nkey=value","expect":{}},{"entry":"main","kind":"accept","input":"key = value","expect":{}},{"entry":"main","kind":"accept","input":"a=1\nb:2\n;c\n#d\n[ s ]\nx=y","expect":{}},{"entry":"main","kind":"accept","input":"[a]\n[b]","expect":{}},{"entry":"main","kind":"accept","input":"empty=","expect":{}},{"entry":"main","kind":"accept","input":"; only a comment","expect":{}},{"entry":"main","kind":"accept","input":"key = value with; semicolon and # hash","expect":{}},{"entry":"main","kind":"accept","input":"flag\nother key = spaced","expect":{}},{"entry":"main","kind":"accept","input":"[top]\n\n[bottom]\nk = v\n","expect":{}},{"entry":"main","kind":"reject","input":"=novalue","expect":{}},{"entry":"main","kind":"reject","input":"[unclosed","expect":{}},{"entry":"main","kind":"reject","input":"a=b\n]stray","expect":{}},{"entry":"main","kind":"reject","input":"a=b\n = x","expect":{}}],"docs":{"ini":"ini = *( blank / comment / section / setting ); each line shape\nconsumes its own terminator, optional at end of document.","setting":"key = value or key: value — the separator tail is optional, so a\nbare key line (\"flag\") is a setting with an absent value.","name_char":"name chars: everything except CR/LF and the structural marks\n(= : [ ] ; #). Keys and section names share the class."},"source":"# INI: the classic configuration-file grammar — the third\n# general-purpose data-format flavor (parsanol-rs#531 grammar\n# breadth). The common INI denominator: optional sections, key=value\n# (or key:value), ; and # comments, values running to end of line.\n# Dialect notes: keys may contain spaces; a whitespace-only line is a\n# blank (ordered choice matches blank before setting); values keep\n# inline ; and # (inline comments are a dialect extension — not\n# consumed here). Line endings: CRLF or bare LF; the final line may\n# omit the terminator. An empty document parses (zero lines).\n\ngrammar Ini version \"1.0.0\" edition 2 {\n crlf = %x0D %x0A\n lf = %x0A\n ws = *( %x20 / %x09 )\n\n ## ini = *( blank / comment / section / setting ); each line shape\n ## consumes its own terminator, optional at end of document.\n ini = *( blank / comment / section / setting )\n\n blank = ( ws nl ) as blank\n\n comment = ( ws comment_mark *( %x20-10FFFF ) [ nl ] ) as comment\n comment_mark = %x3B / %x23\n\n section = ( ws %x5B ws section_name ws %x5D ws [ nl ] ) as section\n section_name = ( 1*name_char ) as name\n\n ## key = value or key: value — the separator tail is optional, so a\n ## bare key line (\"flag\") is a setting with an absent value.\n setting = ( ws key ws [ setting_tail ] [ nl ] ) as setting\n setting_tail = ( ( %x3D / %x3A ) ws *( %x20-10FFFF ) )\n key = ( 1*name_char ) as key\n\n ## name chars: everything except CR/LF and the structural marks\n ## (= : [ ] ; #). Keys and section names share the class.\n name_char = %x20-22 / %x24-39 / %x3C / %x3E-5A / %x5C / %x5E-10FFFF\n\n nl = crlf / lf\n\n entry main: ini\n\n test {\n accept \"[section]\\nkey=value\"\n accept \"key = value\"\n accept \"a=1\\nb:2\\n;c\\n#d\\n[ s ]\\nx=y\"\n accept \"[a]\\n[b]\"\n accept \"empty=\"\n accept \"; only a comment\"\n accept \"key = value with; semicolon and # hash\"\n accept \"flag\\nother key = spaced\"\n accept \"[top]\\n\\n[bottom]\\nk = v\\n\"\n reject \"=novalue\"\n reject \"[unclosed\"\n reject \"a=b\\n]stray\"\n reject \"a=b\\n = x\"\n }\n}\n","source_hash":"70a7b5c468797dd390971e31f462db71dde4ba0ce0b48887122a5824082f18be","unicode_tables":"onigmo (Ruby 4.0.7)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:9369ac09f2fba07c4c2c93f9240d604e8b4a66e70c8bf51b5c74f9b47418b810","checksum":"sha256:af9a2cf139d902a4d7ebd6cf4001a2ebb7afd296c992b982497cc684dde17730","validated":{"lint_errors":0,"lint_warnings":5,"tests_total":13,"tests_failures":0,"self_test":true}}
1
+ {"bindings":null,"version":"1.0.0","grammar":"Ini","shape":"parsanol-tree/v2","binding_version":1,"entries":{"main":{"root":"ini","grammar":{"atoms":[{"Entity":{"atom":15}},{"Entity":{"atom":5}},{"Re":{"pattern":"[ ]"}},{"Re":{"pattern":"[\\x09]"}},{"Alternative":{"atoms":[2,3]}},{"Repetition":{"atom":4,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":13}},{"Entity":{"atom":10}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[8,9]}},{"Entity":{"atom":12}},{"Re":{"pattern":"[\\x0a]"}},{"Alternative":{"atoms":[7,11]}},{"Sequence":{"atoms":[1,6]}},{"Named":{"name":"blank","atom":14}},{"Entity":{"atom":27}},{"Entity":{"atom":5}},{"Entity":{"atom":21}},{"Re":{"pattern":"[;]"}},{"Re":{"pattern":"[#]"}},{"Alternative":{"atoms":[19,20]}},{"Re":{"pattern":"[\\x20-\\u{10ffff}]"}},{"Repetition":{"atom":22,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":13}},{"Repetition":{"atom":24,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[17,18,23,25]}},{"Named":{"name":"comment","atom":26}},{"Entity":{"atom":49}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\[]"}},{"Entity":{"atom":5}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Re":{"pattern":"[\\x20-\\x22]"}},{"Re":{"pattern":"[\\x24-\\x39]"}},{"Re":{"pattern":"[<]"}},{"Re":{"pattern":"[\\x3e-\\x5a]"}},{"Re":{"pattern":"[\\\\]"}},{"Re":{"pattern":"[\\x5e-\\u{10ffff}]"}},{"Alternative":{"atoms":[34,35,36,37,38,39]}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"name","atom":41}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\]]"}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[29,30,31,32,43,44,45,47]}},{"Named":{"name":"section","atom":48}},{"Entity":{"atom":69}},{"Entity":{"atom":5}},{"Entity":{"atom":55}},{"Entity":{"atom":40}},{"Repetition":{"atom":53,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"key","atom":54}},{"Entity":{"atom":5}},{"Entity":{"atom":64}},{"Re":{"pattern":"[=]"}},{"Re":{"pattern":"[:]"}},{"Alternative":{"atoms":[58,59]}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x20-\\u{10ffff}]"}},{"Repetition":{"atom":62,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[60,61,63]}},{"Repetition":{"atom":57,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":13}},{"Repetition":{"atom":66,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[51,52,56,65,67]}},{"Named":{"name":"setting","atom":68}},{"Alternative":{"atoms":[0,16,28,50]}},{"Repetition":{"atom":70,"min":0,"max":null,"tag":"Repetition"}}],"root":71},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule name_char: branches 1 and 6 are order-dependent (first set not statically known)","rule name_char: branches 2 and 6 are order-dependent (first set not statically known)","rule name_char: branches 3 and 6 are order-dependent (first set not statically known)","rule name_char: branches 4 and 6 are order-dependent (first set not statically known)","rule name_char: branches 5 and 6 are order-dependent (first set not statically known)"]},"default_entry":"main","render":{},"derive":{},"tests":[{"entry":"main","kind":"accept","input":"[section]\nkey=value","expect":{}},{"entry":"main","kind":"accept","input":"key = value","expect":{}},{"entry":"main","kind":"accept","input":"a=1\nb:2\n;c\n#d\n[ s ]\nx=y","expect":{}},{"entry":"main","kind":"accept","input":"[a]\n[b]","expect":{}},{"entry":"main","kind":"accept","input":"empty=","expect":{}},{"entry":"main","kind":"accept","input":"; only a comment","expect":{}},{"entry":"main","kind":"accept","input":"key = value with; semicolon and # hash","expect":{}},{"entry":"main","kind":"accept","input":"flag\nother key = spaced","expect":{}},{"entry":"main","kind":"accept","input":"[top]\n\n[bottom]\nk = v\n","expect":{}},{"entry":"main","kind":"reject","input":"=novalue","expect":{}},{"entry":"main","kind":"reject","input":"[unclosed","expect":{}},{"entry":"main","kind":"reject","input":"a=b\n]stray","expect":{}},{"entry":"main","kind":"reject","input":"a=b\n = x","expect":{}}],"docs":{"ini":"ini = *( blank / comment / section / setting ); each line shape\nconsumes its own terminator, optional at end of document.","setting":"key = value or key: value — the separator tail is optional, so a\nbare key line (\"flag\") is a setting with an absent value.","name_char":"name chars: everything except CR/LF and the structural marks\n(= : [ ] ; #). Keys and section names share the class."},"source":"# INI: the classic configuration-file grammar — the third\n# general-purpose data-format flavor (parsanol-rs#531 grammar\n# breadth). The common INI denominator: optional sections, key=value\n# (or key:value), ; and # comments, values running to end of line.\n# Dialect notes: keys may contain spaces; a whitespace-only line is a\n# blank (ordered choice matches blank before setting); values keep\n# inline ; and # (inline comments are a dialect extension — not\n# consumed here). Line endings: CRLF or bare LF; the final line may\n# omit the terminator. An empty document parses (zero lines).\n\ngrammar Ini version \"1.0.0\" edition 2 {\n crlf = %x0D %x0A\n lf = %x0A\n ws = *( %x20 / %x09 )\n\n ## ini = *( blank / comment / section / setting ); each line shape\n ## consumes its own terminator, optional at end of document.\n ini = *( blank / comment / section / setting )\n\n blank = ( ws nl ) as blank\n\n comment = ( ws comment_mark *( %x20-10FFFF ) [ nl ] ) as comment\n comment_mark = %x3B / %x23\n\n section = ( ws %x5B ws section_name ws %x5D ws [ nl ] ) as section\n section_name = ( 1*name_char ) as name\n\n ## key = value or key: value — the separator tail is optional, so a\n ## bare key line (\"flag\") is a setting with an absent value.\n setting = ( ws key ws [ setting_tail ] [ nl ] ) as setting\n setting_tail = ( ( %x3D / %x3A ) ws *( %x20-10FFFF ) )\n key = ( 1*name_char ) as key\n\n ## name chars: everything except CR/LF and the structural marks\n ## (= : [ ] ; #). Keys and section names share the class.\n name_char = %x20-22 / %x24-39 / %x3C / %x3E-5A / %x5C / %x5E-10FFFF\n\n nl = crlf / lf\n\n entry main: ini\n\n test {\n accept \"[section]\\nkey=value\"\n accept \"key = value\"\n accept \"a=1\\nb:2\\n;c\\n#d\\n[ s ]\\nx=y\"\n accept \"[a]\\n[b]\"\n accept \"empty=\"\n accept \"; only a comment\"\n accept \"key = value with; semicolon and # hash\"\n accept \"flag\\nother key = spaced\"\n accept \"[top]\\n\\n[bottom]\\nk = v\\n\"\n reject \"=novalue\"\n reject \"[unclosed\"\n reject \"a=b\\n]stray\"\n reject \"a=b\\n = x\"\n }\n}\n","source_hash":"70a7b5c468797dd390971e31f462db71dde4ba0ce0b48887122a5824082f18be","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:9369ac09f2fba07c4c2c93f9240d604e8b4a66e70c8bf51b5c74f9b47418b810","checksum":"sha256:defd1de2f43d4b302df78854606cd220afe5ec8aed468b8f0def360aa78b86b3","validated":{"lint_errors":0,"lint_warnings":5,"tests_total":13,"tests_failures":0,"self_test":true}}