@formique/semantq 1.1.5 → 1.1.6

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.
package/LowCodeParser.js CHANGED
@@ -166,43 +166,45 @@ function peg$parse(input, options) {
166
166
 
167
167
  const peg$c0 = "@form:";
168
168
  const peg$c1 = ":";
169
- const peg$c2 = "-";
170
- const peg$c3 = "\"";
171
- const peg$c4 = "true";
172
- const peg$c5 = "false";
169
+ const peg$c2 = "\"";
170
+ const peg$c3 = "true";
171
+ const peg$c4 = "false";
172
+ const peg$c5 = "-";
173
173
  const peg$c6 = ",";
174
174
 
175
- const peg$r0 = /^[\r\n]/;
176
- const peg$r1 = /^[^\r\n]/;
177
- const peg$r2 = /^[^"]/;
178
- const peg$r3 = /^[0-9]/;
179
- const peg$r4 = /^[a-zA-Z0-9_\-]/;
180
- const peg$r5 = /^[!*]/;
181
- const peg$r6 = /^[a-zA-Z]/;
182
- const peg$r7 = /^[a-zA-Z0-9_ \-]/;
183
- const peg$r8 = /^[ \t\n\r]/;
184
- const peg$r9 = /^[a-zA-Z_]/;
185
- const peg$r10 = /^[a-zA-Z0-9_.\/:\-?&=()@#%+![\] ]/;
175
+ const peg$r0 = /^[^"]/;
176
+ const peg$r1 = /^[0-9]/;
177
+ const peg$r2 = /^[a-zA-Z0-9_\-*!]/;
178
+ const peg$r3 = /^[a-zA-Z0-9_\-]/;
179
+ const peg$r4 = /^[!*]/;
180
+ const peg$r5 = /^[\r\n]/;
181
+ const peg$r6 = /^[^,\r\n]/;
182
+ const peg$r7 = /^[^\r\n]/;
183
+ const peg$r8 = /^[a-zA-Z]/;
184
+ const peg$r9 = /^[a-zA-Z0-9_ \-]/;
185
+ const peg$r10 = /^[ \t\n\r]/;
186
+ const peg$r11 = /^[a-zA-Z_]/;
186
187
 
187
188
  const peg$e0 = peg$otherExpectation("form directive must be in this format: @form: form-name");
188
189
  const peg$e1 = peg$literalExpectation("@form:", false);
189
190
  const peg$e2 = peg$literalExpectation(":", false);
190
- const peg$e3 = peg$classExpectation(["\r", "\n"], false, false, false);
191
- const peg$e4 = peg$literalExpectation("-", false);
192
- const peg$e5 = peg$classExpectation(["\r", "\n"], true, false, false);
193
- const peg$e6 = peg$literalExpectation("\"", false);
194
- const peg$e7 = peg$classExpectation(["\""], true, false, false);
195
- const peg$e8 = peg$literalExpectation("true", false);
196
- const peg$e9 = peg$literalExpectation("false", false);
197
- const peg$e10 = peg$classExpectation([["0", "9"]], false, false, false);
198
- const peg$e11 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false, false);
199
- const peg$e12 = peg$classExpectation(["!", "*"], false, false, false);
200
- const peg$e13 = peg$literalExpectation(",", false);
201
- const peg$e14 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false, false);
202
- const peg$e15 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", " ", "-"], false, false, false);
203
- const peg$e16 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false, false);
204
- const peg$e17 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false, false);
205
- const peg$e18 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", ".", "/", ":", "-", "?", "&", "=", "(", ")", "@", "#", "%", "+", "!", "[", "]", " "], false, false, false);
191
+ const peg$e3 = peg$literalExpectation("\"", false);
192
+ const peg$e4 = peg$classExpectation(["\""], true, false, false);
193
+ const peg$e5 = peg$literalExpectation("true", false);
194
+ const peg$e6 = peg$literalExpectation("false", false);
195
+ const peg$e7 = peg$classExpectation([["0", "9"]], false, false, false);
196
+ const peg$e8 = peg$literalExpectation("-", false);
197
+ const peg$e9 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-", "*", "!"], false, false, false);
198
+ const peg$e10 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false, false);
199
+ const peg$e11 = peg$classExpectation(["!", "*"], false, false, false);
200
+ const peg$e12 = peg$literalExpectation(",", false);
201
+ const peg$e13 = peg$classExpectation(["\r", "\n"], false, false, false);
202
+ const peg$e14 = peg$classExpectation([",", "\r", "\n"], true, false, false);
203
+ const peg$e15 = peg$classExpectation(["\r", "\n"], true, false, false);
204
+ const peg$e16 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false, false);
205
+ const peg$e17 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", " ", "-"], false, false, false);
206
+ const peg$e18 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false, false);
207
+ const peg$e19 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false, false);
206
208
 
207
209
  function peg$f0(definition) {
208
210
  // definition is already a filtered array from the rule below.
@@ -247,88 +249,112 @@ return createNode('FormDirective', location().start, location().end, {
247
249
  value: contents.join("").replace(/\s+/g, ' ').trim() // Normalizes multiline spaces
248
250
  })
249
251
  }
250
- function peg$f6(char) { return char }
251
- function peg$f7() { return " " }
252
- function peg$f8() {
252
+ function peg$f6() {
253
253
  return createNode('StringLiteral', location().start, location().end, {
254
254
  value: text().slice(1, -1)
255
255
  })
256
256
  }
257
- function peg$f9() {
257
+ function peg$f7() {
258
258
  return createNode('BooleanLiteral', location().start, location().end, {
259
259
  value: text() === "true"
260
260
  })
261
261
  }
262
- function peg$f10() {
262
+ function peg$f8() {
263
263
  return createNode('NumberLiteral', location().start, location().end, {
264
264
  value: parseInt(text(), 10)
265
265
  })
266
266
  }
267
- function peg$f11(fields) {
267
+ function peg$f9(fields) {
268
268
  return createNode('FormFields', location().start, location().end, {
269
269
  fields: fields
270
270
  })
271
271
  }
272
- function peg$f12(name, attributes) {
272
+ function peg$f10(name, attributes) {
273
+ const attrs = attributes || [];
274
+ const optionsAttr = attrs.find(a => a.key === 'options');
275
+
276
+ let fieldType = "standard";
277
+ let primaryValues = [];
278
+
279
+ if (optionsAttr) {
280
+ // Handle both OptionsAttribute (array) and FieldAttribute (string fallback)
281
+ primaryValues = Array.isArray(optionsAttr.values)
282
+ ? optionsAttr.values.map(v => v.value)
283
+ : optionsAttr.value.value.split(',').map(v => v.trim());
284
+
285
+ // 💡 THE CULPRIT: Check if any OTHER attribute key is one of our options
286
+ const hasCascadingRules = attrs.some(a =>
287
+ a.key !== 'options' && primaryValues.includes(a.key)
288
+ );
289
+
290
+ if (hasCascadingRules) {
291
+ fieldType = "dynamicSingleSelect";
292
+ }
293
+ }
294
+
273
295
  return createNode('FormField', location().start, location().end, {
274
- name: name,
275
- attributes: attributes || []
276
- })
296
+ name: name,
297
+ fieldType: fieldType,
298
+ attributes: attrs
299
+ });
277
300
  }
278
- function peg$f13(markers, name, markers2) {
301
+ function peg$f11(markers, name, markers2) {
279
302
  return (markers || '') + name + (markers2 || '')
280
303
  }
281
- function peg$f14(name, namePart, name2, type) {
304
+ function peg$f12(name, namePart, type) {
282
305
  return (name || '') + namePart.join('') + ':' + type.join('')
283
306
  }
284
- function peg$f15() { return text() }
285
- function peg$f16() { return text() }
286
- function peg$f17(attrs) {
307
+ function peg$f13() { return text() }
308
+ function peg$f14() { return text() }
309
+ function peg$f15(attrs) {
287
310
  return attrs.map(attr => attr[1])
288
311
  }
289
- function peg$f18(key, value) { // Consumes trailing spaces/newlines
312
+ function peg$f16() { return Array.isArray(arguments[0]) ? false : text().startsWith("options:") }
313
+ function peg$f17(key, value) { // Consumes trailing spaces/newlines
290
314
  return createNode('FieldAttribute', location().start, location().end, {
291
315
  key: key, // 💡 FIX: Removed .value, since AttributeKey returns a string
292
316
  value: value
293
317
  })
294
318
  }
295
- function peg$f19(flag) {
319
+ function peg$f18(flag) {
296
320
  return createNode('FieldAttribute', location().start, location().end, {
297
321
  key: flag,
298
322
  value: createNode('BooleanLiteral', location().start, location().end, { value: true })
299
323
  })
300
324
  }
301
- function peg$f20(key, values) {
325
+ function peg$f19(key, values) {
302
326
  return createNode('OptionsAttribute', location().start, location().end, {
303
327
  key: key, // 💡 FIX: Removed .value, since AttributeKey returns a string
304
328
  values: values
305
329
  })
306
330
  }
307
- function peg$f21(head, tail) {
331
+ function peg$f20(head, tail) {
308
332
  const options = [head];
309
333
  for (const item of tail) {
310
334
  options.push(item[3]);
311
335
  }
312
336
  return options;
313
337
  }
314
- function peg$f22(option) {
338
+ function peg$f21(option) {
315
339
  return [option];
316
340
  }
317
- function peg$f23(value) {
341
+ function peg$f22(value) {
318
342
  return createNode('Option', location().start, location().end, {
319
- value: value.value, // Extract the value from the AttributeValue node
320
- quoted: value.type === 'StringLiteral' // Check if it was a quoted string
343
+ value: value.value,
344
+ quoted: value.type === 'StringLiteral'
321
345
  })
322
346
  }
323
- function peg$f24() { return text() }
324
- function peg$f25() { return text() }
325
- function peg$f26() {
326
- return createNode('Identifier', location().start, location().end, { value: text() })
347
+ function peg$f23(contents) {
348
+ return createNode('StringLiteral', location().start, location().end, {
349
+ value: contents.map(c => c[1]).join("").trim()
350
+ })
327
351
  }
328
- function peg$f27(head, tail) { // 💡 FIX: Added space ' '
329
- return createNode('StringLiteral', location().start, location().end, {
330
- value: text() // Returns the entire matched text
331
- })
352
+ function peg$f24(char) { return char }
353
+ function peg$f25() { return " " }
354
+ function peg$f26() { return text() }
355
+ function peg$f27() { return text() }
356
+ function peg$f28() {
357
+ return createNode('Identifier', location().start, location().end, { value: text() })
332
358
  }
333
359
  let peg$currPos = options.peg$currPos | 0;
334
360
  let peg$savedPos = peg$currPos;
@@ -688,233 +714,46 @@ return createNode('Identifier', location().start, location().end, { value: text(
688
714
  return s0;
689
715
  }
690
716
 
691
- function peg$parseUnquotedLine() {
692
- let s0, s1, s2, s3, s4, s5, s6, s7;
693
-
694
- s0 = peg$currPos;
695
- s1 = peg$currPos;
696
- peg$silentFails++;
697
- s2 = peg$currPos;
698
- s3 = [];
699
- s4 = input.charAt(peg$currPos);
700
- if (peg$r0.test(s4)) {
701
- peg$currPos++;
702
- } else {
703
- s4 = peg$FAILED;
704
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
705
- }
706
- if (s4 !== peg$FAILED) {
707
- while (s4 !== peg$FAILED) {
708
- s3.push(s4);
709
- s4 = input.charAt(peg$currPos);
710
- if (peg$r0.test(s4)) {
711
- peg$currPos++;
712
- } else {
713
- s4 = peg$FAILED;
714
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
715
- }
716
- }
717
- } else {
718
- s3 = peg$FAILED;
719
- }
720
- if (s3 !== peg$FAILED) {
721
- s4 = peg$parse_();
722
- if (input.charCodeAt(peg$currPos) === 45) {
723
- s5 = peg$c2;
724
- peg$currPos++;
725
- } else {
726
- s5 = peg$FAILED;
727
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
728
- }
729
- if (s5 === peg$FAILED) {
730
- s5 = peg$currPos;
731
- s6 = peg$parseIdentifier();
732
- if (s6 !== peg$FAILED) {
733
- if (input.charCodeAt(peg$currPos) === 58) {
734
- s7 = peg$c1;
735
- peg$currPos++;
736
- } else {
737
- s7 = peg$FAILED;
738
- if (peg$silentFails === 0) { peg$fail(peg$e2); }
739
- }
740
- if (s7 !== peg$FAILED) {
741
- s6 = [s6, s7];
742
- s5 = s6;
743
- } else {
744
- peg$currPos = s5;
745
- s5 = peg$FAILED;
746
- }
747
- } else {
748
- peg$currPos = s5;
749
- s5 = peg$FAILED;
750
- }
751
- }
752
- if (s5 !== peg$FAILED) {
753
- s3 = [s3, s4, s5];
754
- s2 = s3;
755
- } else {
756
- peg$currPos = s2;
757
- s2 = peg$FAILED;
758
- }
759
- } else {
760
- peg$currPos = s2;
761
- s2 = peg$FAILED;
762
- }
763
- peg$silentFails--;
764
- if (s2 === peg$FAILED) {
765
- s1 = undefined;
766
- } else {
767
- peg$currPos = s1;
768
- s1 = peg$FAILED;
769
- }
770
- if (s1 !== peg$FAILED) {
771
- s2 = input.charAt(peg$currPos);
772
- if (peg$r1.test(s2)) {
773
- peg$currPos++;
774
- } else {
775
- s2 = peg$FAILED;
776
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
777
- }
778
- if (s2 !== peg$FAILED) {
779
- peg$savedPos = s0;
780
- s0 = peg$f6(s2);
781
- } else {
782
- peg$currPos = s0;
783
- s0 = peg$FAILED;
784
- }
785
- } else {
786
- peg$currPos = s0;
787
- s0 = peg$FAILED;
788
- }
789
- if (s0 === peg$FAILED) {
790
- s0 = peg$currPos;
791
- s1 = [];
792
- s2 = input.charAt(peg$currPos);
793
- if (peg$r0.test(s2)) {
794
- peg$currPos++;
795
- } else {
796
- s2 = peg$FAILED;
797
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
798
- }
799
- if (s2 !== peg$FAILED) {
800
- while (s2 !== peg$FAILED) {
801
- s1.push(s2);
802
- s2 = input.charAt(peg$currPos);
803
- if (peg$r0.test(s2)) {
804
- peg$currPos++;
805
- } else {
806
- s2 = peg$FAILED;
807
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
808
- }
809
- }
810
- } else {
811
- s1 = peg$FAILED;
812
- }
813
- if (s1 !== peg$FAILED) {
814
- s2 = peg$currPos;
815
- peg$silentFails++;
816
- s3 = peg$currPos;
817
- s4 = peg$parse_();
818
- if (input.charCodeAt(peg$currPos) === 45) {
819
- s5 = peg$c2;
820
- peg$currPos++;
821
- } else {
822
- s5 = peg$FAILED;
823
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
824
- }
825
- if (s5 === peg$FAILED) {
826
- s5 = peg$currPos;
827
- s6 = peg$parseIdentifier();
828
- if (s6 !== peg$FAILED) {
829
- if (input.charCodeAt(peg$currPos) === 58) {
830
- s7 = peg$c1;
831
- peg$currPos++;
832
- } else {
833
- s7 = peg$FAILED;
834
- if (peg$silentFails === 0) { peg$fail(peg$e2); }
835
- }
836
- if (s7 !== peg$FAILED) {
837
- s6 = [s6, s7];
838
- s5 = s6;
839
- } else {
840
- peg$currPos = s5;
841
- s5 = peg$FAILED;
842
- }
843
- } else {
844
- peg$currPos = s5;
845
- s5 = peg$FAILED;
846
- }
847
- }
848
- if (s5 !== peg$FAILED) {
849
- s4 = [s4, s5];
850
- s3 = s4;
851
- } else {
852
- peg$currPos = s3;
853
- s3 = peg$FAILED;
854
- }
855
- peg$silentFails--;
856
- if (s3 === peg$FAILED) {
857
- s2 = undefined;
858
- } else {
859
- peg$currPos = s2;
860
- s2 = peg$FAILED;
861
- }
862
- if (s2 !== peg$FAILED) {
863
- peg$savedPos = s0;
864
- s0 = peg$f7();
865
- } else {
866
- peg$currPos = s0;
867
- s0 = peg$FAILED;
868
- }
869
- } else {
870
- peg$currPos = s0;
871
- s0 = peg$FAILED;
872
- }
873
- }
874
-
875
- return s0;
876
- }
877
-
878
717
  function peg$parseStringLiteral() {
879
718
  let s0, s1, s2, s3;
880
719
 
881
720
  s0 = peg$currPos;
882
721
  if (input.charCodeAt(peg$currPos) === 34) {
883
- s1 = peg$c3;
722
+ s1 = peg$c2;
884
723
  peg$currPos++;
885
724
  } else {
886
725
  s1 = peg$FAILED;
887
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
726
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
888
727
  }
889
728
  if (s1 !== peg$FAILED) {
890
729
  s2 = [];
891
730
  s3 = input.charAt(peg$currPos);
892
- if (peg$r2.test(s3)) {
731
+ if (peg$r0.test(s3)) {
893
732
  peg$currPos++;
894
733
  } else {
895
734
  s3 = peg$FAILED;
896
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
735
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
897
736
  }
898
737
  while (s3 !== peg$FAILED) {
899
738
  s2.push(s3);
900
739
  s3 = input.charAt(peg$currPos);
901
- if (peg$r2.test(s3)) {
740
+ if (peg$r0.test(s3)) {
902
741
  peg$currPos++;
903
742
  } else {
904
743
  s3 = peg$FAILED;
905
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
744
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
906
745
  }
907
746
  }
908
747
  if (input.charCodeAt(peg$currPos) === 34) {
909
- s3 = peg$c3;
748
+ s3 = peg$c2;
910
749
  peg$currPos++;
911
750
  } else {
912
751
  s3 = peg$FAILED;
913
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
752
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
914
753
  }
915
754
  if (s3 !== peg$FAILED) {
916
755
  peg$savedPos = s0;
917
- s0 = peg$f8();
756
+ s0 = peg$f6();
918
757
  } else {
919
758
  peg$currPos = s0;
920
759
  s0 = peg$FAILED;
@@ -931,25 +770,25 @@ return createNode('Identifier', location().start, location().end, { value: text(
931
770
  let s0, s1;
932
771
 
933
772
  s0 = peg$currPos;
934
- if (input.substr(peg$currPos, 4) === peg$c4) {
935
- s1 = peg$c4;
773
+ if (input.substr(peg$currPos, 4) === peg$c3) {
774
+ s1 = peg$c3;
936
775
  peg$currPos += 4;
937
776
  } else {
938
777
  s1 = peg$FAILED;
939
- if (peg$silentFails === 0) { peg$fail(peg$e8); }
778
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
940
779
  }
941
780
  if (s1 === peg$FAILED) {
942
- if (input.substr(peg$currPos, 5) === peg$c5) {
943
- s1 = peg$c5;
781
+ if (input.substr(peg$currPos, 5) === peg$c4) {
782
+ s1 = peg$c4;
944
783
  peg$currPos += 5;
945
784
  } else {
946
785
  s1 = peg$FAILED;
947
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
786
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
948
787
  }
949
788
  }
950
789
  if (s1 !== peg$FAILED) {
951
790
  peg$savedPos = s0;
952
- s1 = peg$f9();
791
+ s1 = peg$f7();
953
792
  }
954
793
  s0 = s1;
955
794
 
@@ -962,21 +801,21 @@ return createNode('Identifier', location().start, location().end, { value: text(
962
801
  s0 = peg$currPos;
963
802
  s1 = [];
964
803
  s2 = input.charAt(peg$currPos);
965
- if (peg$r3.test(s2)) {
804
+ if (peg$r1.test(s2)) {
966
805
  peg$currPos++;
967
806
  } else {
968
807
  s2 = peg$FAILED;
969
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
808
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
970
809
  }
971
810
  if (s2 !== peg$FAILED) {
972
811
  while (s2 !== peg$FAILED) {
973
812
  s1.push(s2);
974
813
  s2 = input.charAt(peg$currPos);
975
- if (peg$r3.test(s2)) {
814
+ if (peg$r1.test(s2)) {
976
815
  peg$currPos++;
977
816
  } else {
978
817
  s2 = peg$FAILED;
979
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
818
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
980
819
  }
981
820
  }
982
821
  } else {
@@ -984,7 +823,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
984
823
  }
985
824
  if (s1 !== peg$FAILED) {
986
825
  peg$savedPos = s0;
987
- s1 = peg$f10();
826
+ s1 = peg$f8();
988
827
  }
989
828
  s0 = s1;
990
829
 
@@ -1008,7 +847,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1008
847
  }
1009
848
  if (s2 !== peg$FAILED) {
1010
849
  peg$savedPos = s0;
1011
- s0 = peg$f11(s2);
850
+ s0 = peg$f9(s2);
1012
851
  } else {
1013
852
  peg$currPos = s0;
1014
853
  s0 = peg$FAILED;
@@ -1022,11 +861,11 @@ return createNode('Identifier', location().start, location().end, { value: text(
1022
861
 
1023
862
  s0 = peg$currPos;
1024
863
  if (input.charCodeAt(peg$currPos) === 45) {
1025
- s1 = peg$c2;
864
+ s1 = peg$c5;
1026
865
  peg$currPos++;
1027
866
  } else {
1028
867
  s1 = peg$FAILED;
1029
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
868
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
1030
869
  }
1031
870
  if (s1 !== peg$FAILED) {
1032
871
  s2 = peg$parse_();
@@ -1035,7 +874,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1035
874
  s4 = peg$parseFieldAttributes();
1036
875
  s5 = peg$parse_();
1037
876
  peg$savedPos = s0;
1038
- s0 = peg$f12(s3, s4);
877
+ s0 = peg$f10(s3, s4);
1039
878
  } else {
1040
879
  peg$currPos = s0;
1041
880
  s0 = peg$FAILED;
@@ -1067,7 +906,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1067
906
  }
1068
907
  s7 = peg$parse_();
1069
908
  peg$savedPos = s0;
1070
- s0 = peg$f13(s2, s4, s6);
909
+ s0 = peg$f11(s2, s4, s6);
1071
910
  } else {
1072
911
  peg$currPos = s0;
1073
912
  s0 = peg$FAILED;
@@ -1088,7 +927,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1088
927
  }
1089
928
 
1090
929
  function peg$parseNameWithType() {
1091
- let s0, s1, s2, s3, s4, s5, s6, s7;
930
+ let s0, s1, s2, s3, s4, s5, s6;
1092
931
 
1093
932
  s0 = peg$currPos;
1094
933
  s1 = peg$parseFieldMarkers();
@@ -1097,65 +936,61 @@ return createNode('Identifier', location().start, location().end, { value: text(
1097
936
  }
1098
937
  s2 = [];
1099
938
  s3 = input.charAt(peg$currPos);
1100
- if (peg$r4.test(s3)) {
939
+ if (peg$r2.test(s3)) {
1101
940
  peg$currPos++;
1102
941
  } else {
1103
942
  s3 = peg$FAILED;
1104
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
943
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
1105
944
  }
1106
945
  if (s3 !== peg$FAILED) {
1107
946
  while (s3 !== peg$FAILED) {
1108
947
  s2.push(s3);
1109
948
  s3 = input.charAt(peg$currPos);
1110
- if (peg$r4.test(s3)) {
949
+ if (peg$r2.test(s3)) {
1111
950
  peg$currPos++;
1112
951
  } else {
1113
952
  s3 = peg$FAILED;
1114
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
953
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
1115
954
  }
1116
955
  }
1117
956
  } else {
1118
957
  s2 = peg$FAILED;
1119
958
  }
1120
959
  if (s2 !== peg$FAILED) {
1121
- s3 = peg$parseFieldMarkers();
1122
- if (s3 === peg$FAILED) {
1123
- s3 = null;
1124
- }
1125
960
  if (input.charCodeAt(peg$currPos) === 58) {
1126
- s4 = peg$c1;
961
+ s3 = peg$c1;
1127
962
  peg$currPos++;
1128
963
  } else {
1129
- s4 = peg$FAILED;
964
+ s3 = peg$FAILED;
1130
965
  if (peg$silentFails === 0) { peg$fail(peg$e2); }
1131
966
  }
1132
- if (s4 !== peg$FAILED) {
1133
- s5 = peg$parse_();
1134
- s6 = [];
1135
- s7 = input.charAt(peg$currPos);
1136
- if (peg$r4.test(s7)) {
967
+ if (s3 !== peg$FAILED) {
968
+ s4 = peg$parse_();
969
+ s5 = [];
970
+ s6 = input.charAt(peg$currPos);
971
+ if (peg$r3.test(s6)) {
1137
972
  peg$currPos++;
1138
973
  } else {
1139
- s7 = peg$FAILED;
1140
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
974
+ s6 = peg$FAILED;
975
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1141
976
  }
1142
- if (s7 !== peg$FAILED) {
1143
- while (s7 !== peg$FAILED) {
1144
- s6.push(s7);
1145
- s7 = input.charAt(peg$currPos);
1146
- if (peg$r4.test(s7)) {
977
+ if (s6 !== peg$FAILED) {
978
+ while (s6 !== peg$FAILED) {
979
+ s5.push(s6);
980
+ s6 = input.charAt(peg$currPos);
981
+ if (peg$r3.test(s6)) {
1147
982
  peg$currPos++;
1148
983
  } else {
1149
- s7 = peg$FAILED;
1150
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
984
+ s6 = peg$FAILED;
985
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1151
986
  }
1152
987
  }
1153
988
  } else {
1154
- s6 = peg$FAILED;
989
+ s5 = peg$FAILED;
1155
990
  }
1156
- if (s6 !== peg$FAILED) {
991
+ if (s5 !== peg$FAILED) {
1157
992
  peg$savedPos = s0;
1158
- s0 = peg$f14(s1, s2, s3, s6);
993
+ s0 = peg$f12(s1, s2, s5);
1159
994
  } else {
1160
995
  peg$currPos = s0;
1161
996
  s0 = peg$FAILED;
@@ -1178,21 +1013,21 @@ return createNode('Identifier', location().start, location().end, { value: text(
1178
1013
  s0 = peg$currPos;
1179
1014
  s1 = [];
1180
1015
  s2 = input.charAt(peg$currPos);
1181
- if (peg$r4.test(s2)) {
1016
+ if (peg$r3.test(s2)) {
1182
1017
  peg$currPos++;
1183
1018
  } else {
1184
1019
  s2 = peg$FAILED;
1185
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1020
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1186
1021
  }
1187
1022
  if (s2 !== peg$FAILED) {
1188
1023
  while (s2 !== peg$FAILED) {
1189
1024
  s1.push(s2);
1190
1025
  s2 = input.charAt(peg$currPos);
1191
- if (peg$r4.test(s2)) {
1026
+ if (peg$r3.test(s2)) {
1192
1027
  peg$currPos++;
1193
1028
  } else {
1194
1029
  s2 = peg$FAILED;
1195
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1030
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1196
1031
  }
1197
1032
  }
1198
1033
  } else {
@@ -1200,7 +1035,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1200
1035
  }
1201
1036
  if (s1 !== peg$FAILED) {
1202
1037
  peg$savedPos = s0;
1203
- s1 = peg$f15();
1038
+ s1 = peg$f13();
1204
1039
  }
1205
1040
  s0 = s1;
1206
1041
 
@@ -1213,21 +1048,21 @@ return createNode('Identifier', location().start, location().end, { value: text(
1213
1048
  s0 = peg$currPos;
1214
1049
  s1 = [];
1215
1050
  s2 = input.charAt(peg$currPos);
1216
- if (peg$r5.test(s2)) {
1051
+ if (peg$r4.test(s2)) {
1217
1052
  peg$currPos++;
1218
1053
  } else {
1219
1054
  s2 = peg$FAILED;
1220
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1055
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1221
1056
  }
1222
1057
  if (s2 !== peg$FAILED) {
1223
1058
  while (s2 !== peg$FAILED) {
1224
1059
  s1.push(s2);
1225
1060
  s2 = input.charAt(peg$currPos);
1226
- if (peg$r5.test(s2)) {
1061
+ if (peg$r4.test(s2)) {
1227
1062
  peg$currPos++;
1228
1063
  } else {
1229
1064
  s2 = peg$FAILED;
1230
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1065
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1231
1066
  }
1232
1067
  }
1233
1068
  } else {
@@ -1235,7 +1070,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1235
1070
  }
1236
1071
  if (s1 !== peg$FAILED) {
1237
1072
  peg$savedPos = s0;
1238
- s1 = peg$f16();
1073
+ s1 = peg$f14();
1239
1074
  }
1240
1075
  s0 = s1;
1241
1076
 
@@ -1271,30 +1106,53 @@ return createNode('Identifier', location().start, location().end, { value: text(
1271
1106
  }
1272
1107
  }
1273
1108
  peg$savedPos = s0;
1274
- s1 = peg$f17(s1);
1109
+ s1 = peg$f15(s1);
1275
1110
  s0 = s1;
1276
1111
 
1277
1112
  return s0;
1278
1113
  }
1279
1114
 
1280
1115
  function peg$parseFieldAttribute() {
1281
- let s0;
1282
-
1283
- s0 = peg$parseOptionsAttribute();
1284
- if (s0 === peg$FAILED) {
1285
- s0 = peg$parseRegularAttribute();
1286
- }
1287
-
1288
- return s0;
1289
- }
1290
-
1291
- function peg$parseRegularAttribute() {
1292
- let s0, s1, s2, s3, s4, s5;
1116
+ let s0, s1, s2;
1293
1117
 
1294
1118
  s0 = peg$currPos;
1295
- s1 = peg$parseAttributeKey();
1296
- if (s1 !== peg$FAILED) {
1297
- if (input.charCodeAt(peg$currPos) === 58) {
1119
+ peg$savedPos = peg$currPos;
1120
+ s1 = peg$f16();
1121
+ if (s1) {
1122
+ s1 = undefined;
1123
+ } else {
1124
+ s1 = peg$FAILED;
1125
+ }
1126
+ if (s1 !== peg$FAILED) {
1127
+ s2 = peg$parseOptionsAttribute();
1128
+ if (s2 !== peg$FAILED) {
1129
+ s1 = [s1, s2];
1130
+ s0 = s1;
1131
+ } else {
1132
+ peg$currPos = s0;
1133
+ s0 = peg$FAILED;
1134
+ }
1135
+ } else {
1136
+ peg$currPos = s0;
1137
+ s0 = peg$FAILED;
1138
+ }
1139
+ if (s0 === peg$FAILED) {
1140
+ s0 = peg$parseRegularAttribute();
1141
+ if (s0 === peg$FAILED) {
1142
+ s0 = peg$parseOptionsAttribute();
1143
+ }
1144
+ }
1145
+
1146
+ return s0;
1147
+ }
1148
+
1149
+ function peg$parseRegularAttribute() {
1150
+ let s0, s1, s2, s3, s4, s5;
1151
+
1152
+ s0 = peg$currPos;
1153
+ s1 = peg$parseAttributeKey();
1154
+ if (s1 !== peg$FAILED) {
1155
+ if (input.charCodeAt(peg$currPos) === 58) {
1298
1156
  s2 = peg$c1;
1299
1157
  peg$currPos++;
1300
1158
  } else {
@@ -1307,7 +1165,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1307
1165
  if (s4 !== peg$FAILED) {
1308
1166
  s5 = peg$parse_();
1309
1167
  peg$savedPos = s0;
1310
- s0 = peg$f18(s1, s4);
1168
+ s0 = peg$f17(s1, s4);
1311
1169
  } else {
1312
1170
  peg$currPos = s0;
1313
1171
  s0 = peg$FAILED;
@@ -1326,7 +1184,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1326
1184
  if (s1 !== peg$FAILED) {
1327
1185
  s2 = peg$parse_();
1328
1186
  peg$savedPos = s0;
1329
- s0 = peg$f19(s1);
1187
+ s0 = peg$f18(s1);
1330
1188
  } else {
1331
1189
  peg$currPos = s0;
1332
1190
  s0 = peg$FAILED;
@@ -1354,7 +1212,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1354
1212
  s4 = peg$parseOptionList();
1355
1213
  if (s4 !== peg$FAILED) {
1356
1214
  peg$savedPos = s0;
1357
- s0 = peg$f20(s1, s4);
1215
+ s0 = peg$f19(s1, s4);
1358
1216
  } else {
1359
1217
  peg$currPos = s0;
1360
1218
  s0 = peg$FAILED;
@@ -1385,7 +1243,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1385
1243
  peg$currPos++;
1386
1244
  } else {
1387
1245
  s5 = peg$FAILED;
1388
- if (peg$silentFails === 0) { peg$fail(peg$e13); }
1246
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1389
1247
  }
1390
1248
  if (s5 !== peg$FAILED) {
1391
1249
  s6 = peg$parse_();
@@ -1410,7 +1268,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1410
1268
  peg$currPos++;
1411
1269
  } else {
1412
1270
  s5 = peg$FAILED;
1413
- if (peg$silentFails === 0) { peg$fail(peg$e13); }
1271
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1414
1272
  }
1415
1273
  if (s5 !== peg$FAILED) {
1416
1274
  s6 = peg$parse_();
@@ -1433,13 +1291,13 @@ return createNode('Identifier', location().start, location().end, { value: text(
1433
1291
  peg$currPos++;
1434
1292
  } else {
1435
1293
  s4 = peg$FAILED;
1436
- if (peg$silentFails === 0) { peg$fail(peg$e13); }
1294
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1437
1295
  }
1438
1296
  if (s4 === peg$FAILED) {
1439
1297
  s4 = null;
1440
1298
  }
1441
1299
  peg$savedPos = s0;
1442
- s0 = peg$f21(s1, s2);
1300
+ s0 = peg$f20(s1, s2);
1443
1301
  } else {
1444
1302
  peg$currPos = s0;
1445
1303
  s0 = peg$FAILED;
@@ -1449,7 +1307,7 @@ return createNode('Identifier', location().start, location().end, { value: text(
1449
1307
  s1 = peg$parseOption();
1450
1308
  if (s1 !== peg$FAILED) {
1451
1309
  peg$savedPos = s0;
1452
- s1 = peg$f22(s1);
1310
+ s1 = peg$f21(s1);
1453
1311
  }
1454
1312
  s0 = s1;
1455
1313
  }
@@ -1460,11 +1318,11 @@ return createNode('Identifier', location().start, location().end, { value: text(
1460
1318
  function peg$parseAttributeValue() {
1461
1319
  let s0;
1462
1320
 
1463
- s0 = peg$parseExtendedIdentifier();
1321
+ s0 = peg$parseStringLiteral();
1464
1322
  if (s0 === peg$FAILED) {
1465
- s0 = peg$parseStringLiteral();
1323
+ s0 = peg$parseUnquotedAttributeString();
1466
1324
  if (s0 === peg$FAILED) {
1467
- s0 = peg$parseUnquotedAttributeString();
1325
+ s0 = peg$parseIdentifier();
1468
1326
  }
1469
1327
  }
1470
1328
 
@@ -1475,7 +1333,187 @@ return createNode('Identifier', location().start, location().end, { value: text(
1475
1333
  let s0, s1;
1476
1334
 
1477
1335
  s0 = peg$currPos;
1478
- s1 = peg$parseAttributeValue();
1336
+ s1 = peg$parseStringLiteral();
1337
+ if (s1 === peg$FAILED) {
1338
+ s1 = peg$parseUnquotedOptionString();
1339
+ }
1340
+ if (s1 !== peg$FAILED) {
1341
+ peg$savedPos = s0;
1342
+ s1 = peg$f22(s1);
1343
+ }
1344
+ s0 = s1;
1345
+
1346
+ return s0;
1347
+ }
1348
+
1349
+ function peg$parseUnquotedOptionString() {
1350
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8;
1351
+
1352
+ s0 = peg$currPos;
1353
+ s1 = [];
1354
+ s2 = peg$currPos;
1355
+ s3 = peg$currPos;
1356
+ peg$silentFails++;
1357
+ s4 = peg$currPos;
1358
+ s5 = [];
1359
+ s6 = input.charAt(peg$currPos);
1360
+ if (peg$r5.test(s6)) {
1361
+ peg$currPos++;
1362
+ } else {
1363
+ s6 = peg$FAILED;
1364
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1365
+ }
1366
+ if (s6 !== peg$FAILED) {
1367
+ while (s6 !== peg$FAILED) {
1368
+ s5.push(s6);
1369
+ s6 = input.charAt(peg$currPos);
1370
+ if (peg$r5.test(s6)) {
1371
+ peg$currPos++;
1372
+ } else {
1373
+ s6 = peg$FAILED;
1374
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1375
+ }
1376
+ }
1377
+ } else {
1378
+ s5 = peg$FAILED;
1379
+ }
1380
+ if (s5 !== peg$FAILED) {
1381
+ s6 = peg$parse_();
1382
+ s7 = peg$parseAttributeKey();
1383
+ if (s7 !== peg$FAILED) {
1384
+ if (input.charCodeAt(peg$currPos) === 58) {
1385
+ s8 = peg$c1;
1386
+ peg$currPos++;
1387
+ } else {
1388
+ s8 = peg$FAILED;
1389
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
1390
+ }
1391
+ if (s8 !== peg$FAILED) {
1392
+ s5 = [s5, s6, s7, s8];
1393
+ s4 = s5;
1394
+ } else {
1395
+ peg$currPos = s4;
1396
+ s4 = peg$FAILED;
1397
+ }
1398
+ } else {
1399
+ peg$currPos = s4;
1400
+ s4 = peg$FAILED;
1401
+ }
1402
+ } else {
1403
+ peg$currPos = s4;
1404
+ s4 = peg$FAILED;
1405
+ }
1406
+ peg$silentFails--;
1407
+ if (s4 === peg$FAILED) {
1408
+ s3 = undefined;
1409
+ } else {
1410
+ peg$currPos = s3;
1411
+ s3 = peg$FAILED;
1412
+ }
1413
+ if (s3 !== peg$FAILED) {
1414
+ s4 = input.charAt(peg$currPos);
1415
+ if (peg$r6.test(s4)) {
1416
+ peg$currPos++;
1417
+ } else {
1418
+ s4 = peg$FAILED;
1419
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1420
+ }
1421
+ if (s4 !== peg$FAILED) {
1422
+ s3 = [s3, s4];
1423
+ s2 = s3;
1424
+ } else {
1425
+ peg$currPos = s2;
1426
+ s2 = peg$FAILED;
1427
+ }
1428
+ } else {
1429
+ peg$currPos = s2;
1430
+ s2 = peg$FAILED;
1431
+ }
1432
+ if (s2 !== peg$FAILED) {
1433
+ while (s2 !== peg$FAILED) {
1434
+ s1.push(s2);
1435
+ s2 = peg$currPos;
1436
+ s3 = peg$currPos;
1437
+ peg$silentFails++;
1438
+ s4 = peg$currPos;
1439
+ s5 = [];
1440
+ s6 = input.charAt(peg$currPos);
1441
+ if (peg$r5.test(s6)) {
1442
+ peg$currPos++;
1443
+ } else {
1444
+ s6 = peg$FAILED;
1445
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1446
+ }
1447
+ if (s6 !== peg$FAILED) {
1448
+ while (s6 !== peg$FAILED) {
1449
+ s5.push(s6);
1450
+ s6 = input.charAt(peg$currPos);
1451
+ if (peg$r5.test(s6)) {
1452
+ peg$currPos++;
1453
+ } else {
1454
+ s6 = peg$FAILED;
1455
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1456
+ }
1457
+ }
1458
+ } else {
1459
+ s5 = peg$FAILED;
1460
+ }
1461
+ if (s5 !== peg$FAILED) {
1462
+ s6 = peg$parse_();
1463
+ s7 = peg$parseAttributeKey();
1464
+ if (s7 !== peg$FAILED) {
1465
+ if (input.charCodeAt(peg$currPos) === 58) {
1466
+ s8 = peg$c1;
1467
+ peg$currPos++;
1468
+ } else {
1469
+ s8 = peg$FAILED;
1470
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
1471
+ }
1472
+ if (s8 !== peg$FAILED) {
1473
+ s5 = [s5, s6, s7, s8];
1474
+ s4 = s5;
1475
+ } else {
1476
+ peg$currPos = s4;
1477
+ s4 = peg$FAILED;
1478
+ }
1479
+ } else {
1480
+ peg$currPos = s4;
1481
+ s4 = peg$FAILED;
1482
+ }
1483
+ } else {
1484
+ peg$currPos = s4;
1485
+ s4 = peg$FAILED;
1486
+ }
1487
+ peg$silentFails--;
1488
+ if (s4 === peg$FAILED) {
1489
+ s3 = undefined;
1490
+ } else {
1491
+ peg$currPos = s3;
1492
+ s3 = peg$FAILED;
1493
+ }
1494
+ if (s3 !== peg$FAILED) {
1495
+ s4 = input.charAt(peg$currPos);
1496
+ if (peg$r6.test(s4)) {
1497
+ peg$currPos++;
1498
+ } else {
1499
+ s4 = peg$FAILED;
1500
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1501
+ }
1502
+ if (s4 !== peg$FAILED) {
1503
+ s3 = [s3, s4];
1504
+ s2 = s3;
1505
+ } else {
1506
+ peg$currPos = s2;
1507
+ s2 = peg$FAILED;
1508
+ }
1509
+ } else {
1510
+ peg$currPos = s2;
1511
+ s2 = peg$FAILED;
1512
+ }
1513
+ }
1514
+ } else {
1515
+ s1 = peg$FAILED;
1516
+ }
1479
1517
  if (s1 !== peg$FAILED) {
1480
1518
  peg$savedPos = s0;
1481
1519
  s1 = peg$f23(s1);
@@ -1485,38 +1523,225 @@ return createNode('Identifier', location().start, location().end, { value: text(
1485
1523
  return s0;
1486
1524
  }
1487
1525
 
1526
+ function peg$parseUnquotedLine() {
1527
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1528
+
1529
+ s0 = peg$currPos;
1530
+ s1 = peg$currPos;
1531
+ peg$silentFails++;
1532
+ s2 = peg$currPos;
1533
+ s3 = [];
1534
+ s4 = input.charAt(peg$currPos);
1535
+ if (peg$r5.test(s4)) {
1536
+ peg$currPos++;
1537
+ } else {
1538
+ s4 = peg$FAILED;
1539
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1540
+ }
1541
+ if (s4 !== peg$FAILED) {
1542
+ while (s4 !== peg$FAILED) {
1543
+ s3.push(s4);
1544
+ s4 = input.charAt(peg$currPos);
1545
+ if (peg$r5.test(s4)) {
1546
+ peg$currPos++;
1547
+ } else {
1548
+ s4 = peg$FAILED;
1549
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1550
+ }
1551
+ }
1552
+ } else {
1553
+ s3 = peg$FAILED;
1554
+ }
1555
+ if (s3 !== peg$FAILED) {
1556
+ s4 = peg$parse_();
1557
+ if (input.charCodeAt(peg$currPos) === 45) {
1558
+ s5 = peg$c5;
1559
+ peg$currPos++;
1560
+ } else {
1561
+ s5 = peg$FAILED;
1562
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
1563
+ }
1564
+ if (s5 === peg$FAILED) {
1565
+ s5 = peg$currPos;
1566
+ s6 = peg$parseAttributeKey();
1567
+ if (s6 !== peg$FAILED) {
1568
+ if (input.charCodeAt(peg$currPos) === 58) {
1569
+ s7 = peg$c1;
1570
+ peg$currPos++;
1571
+ } else {
1572
+ s7 = peg$FAILED;
1573
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
1574
+ }
1575
+ if (s7 !== peg$FAILED) {
1576
+ s6 = [s6, s7];
1577
+ s5 = s6;
1578
+ } else {
1579
+ peg$currPos = s5;
1580
+ s5 = peg$FAILED;
1581
+ }
1582
+ } else {
1583
+ peg$currPos = s5;
1584
+ s5 = peg$FAILED;
1585
+ }
1586
+ }
1587
+ if (s5 !== peg$FAILED) {
1588
+ s3 = [s3, s4, s5];
1589
+ s2 = s3;
1590
+ } else {
1591
+ peg$currPos = s2;
1592
+ s2 = peg$FAILED;
1593
+ }
1594
+ } else {
1595
+ peg$currPos = s2;
1596
+ s2 = peg$FAILED;
1597
+ }
1598
+ peg$silentFails--;
1599
+ if (s2 === peg$FAILED) {
1600
+ s1 = undefined;
1601
+ } else {
1602
+ peg$currPos = s1;
1603
+ s1 = peg$FAILED;
1604
+ }
1605
+ if (s1 !== peg$FAILED) {
1606
+ s2 = input.charAt(peg$currPos);
1607
+ if (peg$r7.test(s2)) {
1608
+ peg$currPos++;
1609
+ } else {
1610
+ s2 = peg$FAILED;
1611
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
1612
+ }
1613
+ if (s2 !== peg$FAILED) {
1614
+ peg$savedPos = s0;
1615
+ s0 = peg$f24(s2);
1616
+ } else {
1617
+ peg$currPos = s0;
1618
+ s0 = peg$FAILED;
1619
+ }
1620
+ } else {
1621
+ peg$currPos = s0;
1622
+ s0 = peg$FAILED;
1623
+ }
1624
+ if (s0 === peg$FAILED) {
1625
+ s0 = peg$currPos;
1626
+ s1 = [];
1627
+ s2 = input.charAt(peg$currPos);
1628
+ if (peg$r5.test(s2)) {
1629
+ peg$currPos++;
1630
+ } else {
1631
+ s2 = peg$FAILED;
1632
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1633
+ }
1634
+ if (s2 !== peg$FAILED) {
1635
+ while (s2 !== peg$FAILED) {
1636
+ s1.push(s2);
1637
+ s2 = input.charAt(peg$currPos);
1638
+ if (peg$r5.test(s2)) {
1639
+ peg$currPos++;
1640
+ } else {
1641
+ s2 = peg$FAILED;
1642
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1643
+ }
1644
+ }
1645
+ } else {
1646
+ s1 = peg$FAILED;
1647
+ }
1648
+ if (s1 !== peg$FAILED) {
1649
+ s2 = peg$currPos;
1650
+ peg$silentFails++;
1651
+ s3 = peg$currPos;
1652
+ s4 = peg$parse_();
1653
+ if (input.charCodeAt(peg$currPos) === 45) {
1654
+ s5 = peg$c5;
1655
+ peg$currPos++;
1656
+ } else {
1657
+ s5 = peg$FAILED;
1658
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
1659
+ }
1660
+ if (s5 === peg$FAILED) {
1661
+ s5 = peg$currPos;
1662
+ s6 = peg$parseAttributeKey();
1663
+ if (s6 !== peg$FAILED) {
1664
+ if (input.charCodeAt(peg$currPos) === 58) {
1665
+ s7 = peg$c1;
1666
+ peg$currPos++;
1667
+ } else {
1668
+ s7 = peg$FAILED;
1669
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
1670
+ }
1671
+ if (s7 !== peg$FAILED) {
1672
+ s6 = [s6, s7];
1673
+ s5 = s6;
1674
+ } else {
1675
+ peg$currPos = s5;
1676
+ s5 = peg$FAILED;
1677
+ }
1678
+ } else {
1679
+ peg$currPos = s5;
1680
+ s5 = peg$FAILED;
1681
+ }
1682
+ }
1683
+ if (s5 !== peg$FAILED) {
1684
+ s4 = [s4, s5];
1685
+ s3 = s4;
1686
+ } else {
1687
+ peg$currPos = s3;
1688
+ s3 = peg$FAILED;
1689
+ }
1690
+ peg$silentFails--;
1691
+ if (s3 === peg$FAILED) {
1692
+ s2 = undefined;
1693
+ } else {
1694
+ peg$currPos = s2;
1695
+ s2 = peg$FAILED;
1696
+ }
1697
+ if (s2 !== peg$FAILED) {
1698
+ peg$savedPos = s0;
1699
+ s0 = peg$f25();
1700
+ } else {
1701
+ peg$currPos = s0;
1702
+ s0 = peg$FAILED;
1703
+ }
1704
+ } else {
1705
+ peg$currPos = s0;
1706
+ s0 = peg$FAILED;
1707
+ }
1708
+ }
1709
+
1710
+ return s0;
1711
+ }
1712
+
1488
1713
  function peg$parseAttributeKey() {
1489
1714
  let s0, s1, s2, s3;
1490
1715
 
1491
1716
  s0 = peg$currPos;
1492
1717
  s1 = input.charAt(peg$currPos);
1493
- if (peg$r6.test(s1)) {
1718
+ if (peg$r8.test(s1)) {
1494
1719
  peg$currPos++;
1495
1720
  } else {
1496
1721
  s1 = peg$FAILED;
1497
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1722
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1498
1723
  }
1499
1724
  if (s1 !== peg$FAILED) {
1500
1725
  s2 = [];
1501
1726
  s3 = input.charAt(peg$currPos);
1502
- if (peg$r7.test(s3)) {
1727
+ if (peg$r9.test(s3)) {
1503
1728
  peg$currPos++;
1504
1729
  } else {
1505
1730
  s3 = peg$FAILED;
1506
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1731
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1507
1732
  }
1508
1733
  while (s3 !== peg$FAILED) {
1509
1734
  s2.push(s3);
1510
1735
  s3 = input.charAt(peg$currPos);
1511
- if (peg$r7.test(s3)) {
1736
+ if (peg$r9.test(s3)) {
1512
1737
  peg$currPos++;
1513
1738
  } else {
1514
1739
  s3 = peg$FAILED;
1515
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1740
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1516
1741
  }
1517
1742
  }
1518
1743
  peg$savedPos = s0;
1519
- s0 = peg$f24();
1744
+ s0 = peg$f26();
1520
1745
  } else {
1521
1746
  peg$currPos = s0;
1522
1747
  s0 = peg$FAILED;
@@ -1530,33 +1755,33 @@ return createNode('Identifier', location().start, location().end, { value: text(
1530
1755
 
1531
1756
  s0 = peg$currPos;
1532
1757
  s1 = input.charAt(peg$currPos);
1533
- if (peg$r6.test(s1)) {
1758
+ if (peg$r8.test(s1)) {
1534
1759
  peg$currPos++;
1535
1760
  } else {
1536
1761
  s1 = peg$FAILED;
1537
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1762
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1538
1763
  }
1539
1764
  if (s1 !== peg$FAILED) {
1540
1765
  s2 = [];
1541
1766
  s3 = input.charAt(peg$currPos);
1542
- if (peg$r4.test(s3)) {
1767
+ if (peg$r3.test(s3)) {
1543
1768
  peg$currPos++;
1544
1769
  } else {
1545
1770
  s3 = peg$FAILED;
1546
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1771
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1547
1772
  }
1548
1773
  while (s3 !== peg$FAILED) {
1549
1774
  s2.push(s3);
1550
1775
  s3 = input.charAt(peg$currPos);
1551
- if (peg$r4.test(s3)) {
1776
+ if (peg$r3.test(s3)) {
1552
1777
  peg$currPos++;
1553
1778
  } else {
1554
1779
  s3 = peg$FAILED;
1555
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1780
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1556
1781
  }
1557
1782
  }
1558
1783
  peg$savedPos = s0;
1559
- s0 = peg$f25();
1784
+ s0 = peg$f27();
1560
1785
  } else {
1561
1786
  peg$currPos = s0;
1562
1787
  s0 = peg$FAILED;
@@ -1570,20 +1795,20 @@ return createNode('Identifier', location().start, location().end, { value: text(
1570
1795
 
1571
1796
  s0 = [];
1572
1797
  s1 = input.charAt(peg$currPos);
1573
- if (peg$r8.test(s1)) {
1798
+ if (peg$r10.test(s1)) {
1574
1799
  peg$currPos++;
1575
1800
  } else {
1576
1801
  s1 = peg$FAILED;
1577
- if (peg$silentFails === 0) { peg$fail(peg$e16); }
1802
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1578
1803
  }
1579
1804
  while (s1 !== peg$FAILED) {
1580
1805
  s0.push(s1);
1581
1806
  s1 = input.charAt(peg$currPos);
1582
- if (peg$r8.test(s1)) {
1807
+ if (peg$r10.test(s1)) {
1583
1808
  peg$currPos++;
1584
1809
  } else {
1585
1810
  s1 = peg$FAILED;
1586
- if (peg$silentFails === 0) { peg$fail(peg$e16); }
1811
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1587
1812
  }
1588
1813
  }
1589
1814
 
@@ -1595,73 +1820,33 @@ return createNode('Identifier', location().start, location().end, { value: text(
1595
1820
 
1596
1821
  s0 = peg$currPos;
1597
1822
  s1 = input.charAt(peg$currPos);
1598
- if (peg$r9.test(s1)) {
1823
+ if (peg$r11.test(s1)) {
1599
1824
  peg$currPos++;
1600
1825
  } else {
1601
1826
  s1 = peg$FAILED;
1602
- if (peg$silentFails === 0) { peg$fail(peg$e17); }
1827
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1603
1828
  }
1604
1829
  if (s1 !== peg$FAILED) {
1605
1830
  s2 = [];
1606
1831
  s3 = input.charAt(peg$currPos);
1607
- if (peg$r4.test(s3)) {
1832
+ if (peg$r3.test(s3)) {
1608
1833
  peg$currPos++;
1609
1834
  } else {
1610
1835
  s3 = peg$FAILED;
1611
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1836
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1612
1837
  }
1613
1838
  while (s3 !== peg$FAILED) {
1614
1839
  s2.push(s3);
1615
1840
  s3 = input.charAt(peg$currPos);
1616
- if (peg$r4.test(s3)) {
1841
+ if (peg$r3.test(s3)) {
1617
1842
  peg$currPos++;
1618
1843
  } else {
1619
1844
  s3 = peg$FAILED;
1620
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1621
- }
1622
- }
1623
- peg$savedPos = s0;
1624
- s0 = peg$f26();
1625
- } else {
1626
- peg$currPos = s0;
1627
- s0 = peg$FAILED;
1628
- }
1629
-
1630
- return s0;
1631
- }
1632
-
1633
- function peg$parseExtendedIdentifier() {
1634
- let s0, s1, s2, s3;
1635
-
1636
- s0 = peg$currPos;
1637
- s1 = input.charAt(peg$currPos);
1638
- if (peg$r9.test(s1)) {
1639
- peg$currPos++;
1640
- } else {
1641
- s1 = peg$FAILED;
1642
- if (peg$silentFails === 0) { peg$fail(peg$e17); }
1643
- }
1644
- if (s1 !== peg$FAILED) {
1645
- s2 = [];
1646
- s3 = input.charAt(peg$currPos);
1647
- if (peg$r10.test(s3)) {
1648
- peg$currPos++;
1649
- } else {
1650
- s3 = peg$FAILED;
1651
- if (peg$silentFails === 0) { peg$fail(peg$e18); }
1652
- }
1653
- while (s3 !== peg$FAILED) {
1654
- s2.push(s3);
1655
- s3 = input.charAt(peg$currPos);
1656
- if (peg$r10.test(s3)) {
1657
- peg$currPos++;
1658
- } else {
1659
- s3 = peg$FAILED;
1660
- if (peg$silentFails === 0) { peg$fail(peg$e18); }
1845
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1661
1846
  }
1662
1847
  }
1663
1848
  peg$savedPos = s0;
1664
- s0 = peg$f27(s1, s2);
1849
+ s0 = peg$f28();
1665
1850
  } else {
1666
1851
  peg$currPos = s0;
1667
1852
  s0 = peg$FAILED;