@mirascript/typed 0.1.64 → 0.1.70

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/dist/type.js CHANGED
@@ -188,27 +188,31 @@ function peg$parse(input, options) {
188
188
  let peg$startRuleFunction = peg$parseStart;
189
189
 
190
190
  const peg$c0 = "|";
191
- const peg$c1 = "[]";
192
- const peg$c2 = "<";
193
- const peg$c3 = ">";
194
- const peg$c4 = "(";
195
- const peg$c5 = ")";
196
- const peg$c6 = ",";
197
- const peg$c7 = "fn";
198
- const peg$c8 = "->";
199
- const peg$c9 = "..";
200
- const peg$c10 = ":";
201
- const peg$c11 = "?";
202
- const peg$c12 = "\\";
203
- const peg$c13 = "\\x";
204
- const peg$c14 = "\\u{";
205
- const peg$c15 = "}";
206
- const peg$c16 = "\"";
207
- const peg$c17 = "'";
208
- const peg$c18 = "`";
209
- const peg$c19 = "$";
210
- const peg$c20 = "_";
211
- const peg$c21 = "@";
191
+ const peg$c1 = "&";
192
+ const peg$c2 = "[]";
193
+ const peg$c3 = "<";
194
+ const peg$c4 = ">";
195
+ const peg$c5 = "(";
196
+ const peg$c6 = ")";
197
+ const peg$c7 = "type";
198
+ const peg$c8 = "[";
199
+ const peg$c9 = "]";
200
+ const peg$c10 = ",";
201
+ const peg$c11 = "..";
202
+ const peg$c12 = "fn";
203
+ const peg$c13 = "->";
204
+ const peg$c14 = ":";
205
+ const peg$c15 = "?";
206
+ const peg$c16 = "\\";
207
+ const peg$c17 = "\\x";
208
+ const peg$c18 = "\\u{";
209
+ const peg$c19 = "}";
210
+ const peg$c20 = "\"";
211
+ const peg$c21 = "'";
212
+ const peg$c22 = "`";
213
+ const peg$c23 = "$";
214
+ const peg$c24 = "_";
215
+ const peg$c25 = "@";
212
216
 
213
217
  const peg$r0 = /^[0-9a-f]/i;
214
218
  const peg$r1 = /^['"`\\nrtbfv0$]/;
@@ -220,49 +224,56 @@ function peg$parse(input, options) {
220
224
  const peg$r7 = /^[ \t\v\f\r\n]/;
221
225
 
222
226
  const peg$e0 = peg$literalExpectation("|", false);
223
- const peg$e1 = peg$literalExpectation("[]", false);
224
- const peg$e2 = peg$literalExpectation("<", false);
225
- const peg$e3 = peg$literalExpectation(">", false);
226
- const peg$e4 = peg$literalExpectation("(", false);
227
- const peg$e5 = peg$literalExpectation(")", false);
228
- const peg$e6 = peg$literalExpectation(",", false);
229
- const peg$e7 = peg$literalExpectation("fn", false);
230
- const peg$e8 = peg$literalExpectation("->", false);
231
- const peg$e9 = peg$literalExpectation("..", false);
232
- const peg$e10 = peg$literalExpectation(":", false);
233
- const peg$e11 = peg$literalExpectation("?", false);
234
- const peg$e12 = peg$otherExpectation("hex digit");
235
- const peg$e13 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true, false);
236
- const peg$e14 = peg$literalExpectation("\\", false);
237
- const peg$e15 = peg$classExpectation(["'", "\"", "`", "\\", "n", "r", "t", "b", "f", "v", "0", "$"], false, false, false);
238
- const peg$e16 = peg$literalExpectation("\\x", false);
239
- const peg$e17 = peg$literalExpectation("\\u{", false);
240
- const peg$e18 = peg$literalExpectation("}", false);
241
- const peg$e19 = peg$otherExpectation("string");
242
- const peg$e20 = peg$literalExpectation("\"", false);
243
- const peg$e21 = peg$literalExpectation("'", false);
244
- const peg$e22 = peg$literalExpectation("`", false);
245
- const peg$e23 = peg$literalExpectation("$", false);
246
- const peg$e24 = peg$classExpectation(["\\", "$", "\""], true, false, false);
247
- const peg$e25 = peg$classExpectation(["\\", "$", "'"], true, false, false);
248
- const peg$e26 = peg$classExpectation(["\\", "$", "`"], true, false, false);
249
- const peg$e27 = peg$otherExpectation("identifier");
250
- const peg$e28 = peg$literalExpectation("_", false);
251
- const peg$e29 = peg$literalExpectation("@", false);
252
- const peg$e30 = peg$classExpectation(["\\p{XID_Start}"], false, false, true);
253
- const peg$e31 = peg$classExpectation(["\\p{XID_Continue}"], false, false, true);
254
- const peg$e32 = peg$classExpectation([" ", "\t", "\v", "\f", "\r", "\n"], false, false, false);
227
+ const peg$e1 = peg$literalExpectation("&", false);
228
+ const peg$e2 = peg$literalExpectation("[]", false);
229
+ const peg$e3 = peg$literalExpectation("<", false);
230
+ const peg$e4 = peg$literalExpectation(">", false);
231
+ const peg$e5 = peg$literalExpectation("(", false);
232
+ const peg$e6 = peg$literalExpectation(")", false);
233
+ const peg$e7 = peg$literalExpectation("type", false);
234
+ const peg$e8 = peg$literalExpectation("[", false);
235
+ const peg$e9 = peg$literalExpectation("]", false);
236
+ const peg$e10 = peg$literalExpectation(",", false);
237
+ const peg$e11 = peg$literalExpectation("..", false);
238
+ const peg$e12 = peg$literalExpectation("fn", false);
239
+ const peg$e13 = peg$literalExpectation("->", false);
240
+ const peg$e14 = peg$literalExpectation(":", false);
241
+ const peg$e15 = peg$literalExpectation("?", false);
242
+ const peg$e16 = peg$otherExpectation("hex digit");
243
+ const peg$e17 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true, false);
244
+ const peg$e18 = peg$literalExpectation("\\", false);
245
+ const peg$e19 = peg$classExpectation(["'", "\"", "`", "\\", "n", "r", "t", "b", "f", "v", "0", "$"], false, false, false);
246
+ const peg$e20 = peg$literalExpectation("\\x", false);
247
+ const peg$e21 = peg$literalExpectation("\\u{", false);
248
+ const peg$e22 = peg$literalExpectation("}", false);
249
+ const peg$e23 = peg$otherExpectation("string");
250
+ const peg$e24 = peg$literalExpectation("\"", false);
251
+ const peg$e25 = peg$literalExpectation("'", false);
252
+ const peg$e26 = peg$literalExpectation("`", false);
253
+ const peg$e27 = peg$literalExpectation("$", false);
254
+ const peg$e28 = peg$classExpectation(["\\", "$", "\""], true, false, false);
255
+ const peg$e29 = peg$classExpectation(["\\", "$", "'"], true, false, false);
256
+ const peg$e30 = peg$classExpectation(["\\", "$", "`"], true, false, false);
257
+ const peg$e31 = peg$otherExpectation("identifier");
258
+ const peg$e32 = peg$literalExpectation("_", false);
259
+ const peg$e33 = peg$literalExpectation("@", false);
260
+ const peg$e34 = peg$classExpectation(["\\p{XID_Start}"], false, false, true);
261
+ const peg$e35 = peg$classExpectation(["\\p{XID_Continue}"], false, false, true);
262
+ const peg$e36 = peg$classExpectation([" ", "\t", "\v", "\f", "\r", "\n"], false, false, false);
255
263
 
256
264
  function peg$f0(u) {
257
265
  return union(u);
258
266
  }
259
- function peg$f1(base, suffix) {
267
+ function peg$f1(i) {
268
+ return intersection(i);
269
+ }
270
+ function peg$f2(base, suffix) {
260
271
  let t = base;
261
272
  for (const _ of suffix)
262
273
  t = array(t);
263
274
  return t;
264
275
  }
265
- function peg$f2(name, generic) {
276
+ function peg$f3(name, generic) {
266
277
  if (generic) {
267
278
  if (name === 'array') {
268
279
  if (generic.length !== 1) throw new Error("'array' expects one generic type parameter");
@@ -281,54 +292,67 @@ function peg$parse(input, options) {
281
292
  if (BUILT_IN_TYPES.has(name)) {
282
293
  return name;
283
294
  }
295
+ // `type` is a non-reserved keyword — allow it as a plain named type
296
+ if (name === 'type') {
297
+ return name;
298
+ }
284
299
  return named(name);
285
300
  }
286
- function peg$f3(lit) {
301
+ function peg$f4(lit) {
287
302
  if (typeof lit == 'string') return { kind: "literal", value: lit };
288
303
  return lit;
289
304
  }
290
- function peg$f4(body) { return body; }
291
- function peg$f5(name, body) {
305
+ function peg$f5(name) {
306
+ return { kind: "reflection", name };
307
+ }
308
+ function peg$f6(elements) {
309
+ return { kind: "tuple", elements: elements ?? [] };
310
+ }
311
+ function peg$f7(spread, type) {
312
+ return tupleElement(type, spread != null);
313
+ }
314
+ function peg$f8(body) { return body; }
315
+ function peg$f9(name, body) {
292
316
  if (KEYWORDS.includes(name)) throw new Error(`'${name}' is a reserved keyword`);
293
317
  body.name = name;
294
318
  return body;
295
319
  }
296
- function peg$f6(typeParams, params, ret) {
320
+ function peg$f10(typeParams, params, ret) {
297
321
  const result = { kind: "function", params: params ?? [] };
298
322
  if (typeParams !== null) result.typeParams = typeParams.map(name => Symbol(name));
299
323
  if (ret !== null) result.returns = ret;
300
324
  return result;
301
325
  }
302
- function peg$f7(params) {
326
+ function peg$f11(params) {
303
327
  for (let i = 0; i < params.length - 1; i++) {
304
328
  if (params[i].spread) throw new Error("Rest parameter must be last");
305
329
  }
306
330
  return params;
307
331
  }
308
- function peg$f8(spread, name, t) {
332
+ function peg$f12(spread, name, t) {
309
333
  return {
310
334
  name: name ?? "",
311
335
  spread: true,
312
336
  type: t ?? { kind: "array", element: "any" }
313
337
  }
314
338
  }
315
- function peg$f9(name, t) {
339
+ function peg$f13(name, t) {
316
340
  return { name, type: t ?? "any" };
317
341
  }
318
- function peg$f10(fields) { return record(fields ?? []); }
319
- function peg$f11(name, opt, t) {
342
+ function peg$f14(fields) { return record(fields ?? []); }
343
+ function peg$f15(name, opt, t) {
320
344
  return {
321
345
  name,
322
346
  optional: opt != null,
323
347
  type: t
324
348
  };
325
349
  }
326
- function peg$f12(type) { return { type }; }
327
- function peg$f13(name) {
350
+ function peg$f16(type) { return { type }; }
351
+ function peg$f17(name) {
328
352
  if (typeof name != 'string') throw new Error('Field name must be a string literal');
329
353
  return name;
330
354
  }
331
- function peg$f14(char) {
355
+ function peg$f18(char) {
332
356
  switch (char) {
333
357
  case 'n': return '\n';
334
358
  case 'r': return '\r';
@@ -340,13 +364,13 @@ function peg$parse(input, options) {
340
364
  default: return char;
341
365
  }
342
366
  }
343
- function peg$f15(hex) {
367
+ function peg$f19(hex) {
344
368
  const code = parseInt(hex, 16);
345
369
  // Valid ASCII characters are in the range 0x00 to 0x7F.
346
370
  if (code >= 128) throw new Error(`Invalid hex escape sequence: \\x${hex}`);
347
371
  return String.fromCharCode(code);
348
372
  }
349
- function peg$f16(hex) {
373
+ function peg$f20(hex) {
350
374
  const code = parseInt(hex, 16);
351
375
  // Valid Unicode code points are in the range 0x0000 to 0x10FFFF, not including the surrogate halves (0xD800 to 0xDFFF).
352
376
  if (code > 0x10FFFF || (code >= 0xD800 && code <= 0xDFFF)) {
@@ -354,12 +378,12 @@ function peg$parse(input, options) {
354
378
  }
355
379
  return String.fromCodePoint(code);
356
380
  }
357
- function peg$f17(parts) { return string(parts); }
358
- function peg$f18(parts) { return string(parts); }
359
- function peg$f19(parts) { return string(parts); }
360
- function peg$f20(chars) { return literal(chars.join('')); }
361
- function peg$f21(chars) { return literal(chars.join('')); }
362
- function peg$f22(chars) { return literal(chars.join('')); }
381
+ function peg$f21(parts) { return string(parts); }
382
+ function peg$f22(parts) { return string(parts); }
383
+ function peg$f23(parts) { return string(parts); }
384
+ function peg$f24(chars) { return literal(chars.join('')); }
385
+ function peg$f25(chars) { return literal(chars.join('')); }
386
+ function peg$f26(chars) { return literal(chars.join('')); }
363
387
  let peg$currPos = options.peg$currPos | 0;
364
388
  let peg$savedPos = peg$currPos;
365
389
  const peg$posDetailsCache = [{ line: 1, column: 1 }];
@@ -585,7 +609,7 @@ function peg$parse(input, options) {
585
609
  }
586
610
  s3 = peg$currPos;
587
611
  s4 = [];
588
- s5 = peg$parsePostfixType();
612
+ s5 = peg$parseIntersectionType();
589
613
  while (s5 !== peg$FAILED) {
590
614
  s4.push(s5);
591
615
  s5 = peg$currPos;
@@ -607,7 +631,7 @@ function peg$parse(input, options) {
607
631
  s6 = peg$FAILED;
608
632
  }
609
633
  if (s6 !== peg$FAILED) {
610
- s6 = peg$parsePostfixType();
634
+ s6 = peg$parseIntersectionType();
611
635
  if (s6 === peg$FAILED) {
612
636
  peg$currPos = s5;
613
637
  s5 = peg$FAILED;
@@ -635,6 +659,82 @@ function peg$parse(input, options) {
635
659
  return s0;
636
660
  }
637
661
 
662
+ function peg$parseIntersectionType() {
663
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
664
+
665
+ s0 = peg$currPos;
666
+ s1 = peg$parse_();
667
+ s2 = peg$currPos;
668
+ if (input.charCodeAt(peg$currPos) === 38) {
669
+ s3 = peg$c1;
670
+ peg$currPos++;
671
+ } else {
672
+ s3 = peg$FAILED;
673
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
674
+ }
675
+ if (s3 !== peg$FAILED) {
676
+ s4 = peg$parse_();
677
+ s3 = [s3, s4];
678
+ s2 = s3;
679
+ } else {
680
+ peg$currPos = s2;
681
+ s2 = peg$FAILED;
682
+ }
683
+ if (s2 === peg$FAILED) {
684
+ s2 = null;
685
+ }
686
+ s3 = peg$currPos;
687
+ s4 = [];
688
+ s5 = peg$parsePostfixType();
689
+ while (s5 !== peg$FAILED) {
690
+ s4.push(s5);
691
+ s5 = peg$currPos;
692
+ s6 = peg$currPos;
693
+ s7 = peg$parse_();
694
+ if (input.charCodeAt(peg$currPos) === 38) {
695
+ s8 = peg$c1;
696
+ peg$currPos++;
697
+ } else {
698
+ s8 = peg$FAILED;
699
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
700
+ }
701
+ if (s8 !== peg$FAILED) {
702
+ s9 = peg$parse_();
703
+ s7 = [s7, s8, s9];
704
+ s6 = s7;
705
+ } else {
706
+ peg$currPos = s6;
707
+ s6 = peg$FAILED;
708
+ }
709
+ if (s6 !== peg$FAILED) {
710
+ s6 = peg$parsePostfixType();
711
+ if (s6 === peg$FAILED) {
712
+ peg$currPos = s5;
713
+ s5 = peg$FAILED;
714
+ } else {
715
+ s5 = s6;
716
+ }
717
+ } else {
718
+ s5 = s6;
719
+ }
720
+ }
721
+ if (s4.length < 1) {
722
+ peg$currPos = s3;
723
+ s3 = peg$FAILED;
724
+ } else {
725
+ s3 = s4;
726
+ }
727
+ if (s3 !== peg$FAILED) {
728
+ peg$savedPos = s0;
729
+ s0 = peg$f1(s3);
730
+ } else {
731
+ peg$currPos = s0;
732
+ s0 = peg$FAILED;
733
+ }
734
+
735
+ return s0;
736
+ }
737
+
638
738
  function peg$parsePostfixType() {
639
739
  let s0, s1, s2, s3, s4, s5;
640
740
 
@@ -643,12 +743,12 @@ function peg$parse(input, options) {
643
743
  if (s1 !== peg$FAILED) {
644
744
  s2 = [];
645
745
  s3 = peg$currPos;
646
- if (input.substr(peg$currPos, 2) === peg$c1) {
647
- s4 = peg$c1;
746
+ if (input.substr(peg$currPos, 2) === peg$c2) {
747
+ s4 = peg$c2;
648
748
  peg$currPos += 2;
649
749
  } else {
650
750
  s4 = peg$FAILED;
651
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
751
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
652
752
  }
653
753
  if (s4 !== peg$FAILED) {
654
754
  s5 = peg$parse_();
@@ -661,12 +761,12 @@ function peg$parse(input, options) {
661
761
  while (s3 !== peg$FAILED) {
662
762
  s2.push(s3);
663
763
  s3 = peg$currPos;
664
- if (input.substr(peg$currPos, 2) === peg$c1) {
665
- s4 = peg$c1;
764
+ if (input.substr(peg$currPos, 2) === peg$c2) {
765
+ s4 = peg$c2;
666
766
  peg$currPos += 2;
667
767
  } else {
668
768
  s4 = peg$FAILED;
669
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
769
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
670
770
  }
671
771
  if (s4 !== peg$FAILED) {
672
772
  s5 = peg$parse_();
@@ -678,7 +778,7 @@ function peg$parse(input, options) {
678
778
  }
679
779
  }
680
780
  peg$savedPos = s0;
681
- s0 = peg$f1(s1, s2);
781
+ s0 = peg$f2(s1, s2);
682
782
  } else {
683
783
  peg$currPos = s0;
684
784
  s0 = peg$FAILED;
@@ -692,101 +792,304 @@ function peg$parse(input, options) {
692
792
 
693
793
  s0 = peg$parseFunctionType();
694
794
  if (s0 === peg$FAILED) {
695
- s0 = peg$currPos;
696
- s1 = peg$parseIdentifier();
697
- if (s1 !== peg$FAILED) {
698
- s2 = peg$currPos;
699
- s3 = peg$parse_();
700
- if (input.charCodeAt(peg$currPos) === 60) {
701
- s4 = peg$c2;
702
- peg$currPos++;
703
- } else {
704
- s4 = peg$FAILED;
705
- if (peg$silentFails === 0) { peg$fail(peg$e2); }
706
- }
707
- if (s4 !== peg$FAILED) {
708
- s5 = peg$parse_();
709
- s6 = peg$parseTypeArgList();
710
- if (s6 !== peg$FAILED) {
711
- s7 = peg$parse_();
712
- if (input.charCodeAt(peg$currPos) === 62) {
713
- s8 = peg$c3;
795
+ s0 = peg$parseReflectionType();
796
+ if (s0 === peg$FAILED) {
797
+ s0 = peg$parseTupleType();
798
+ if (s0 === peg$FAILED) {
799
+ s0 = peg$currPos;
800
+ s1 = peg$parseIdentifier();
801
+ if (s1 !== peg$FAILED) {
802
+ s2 = peg$currPos;
803
+ s3 = peg$parse_();
804
+ if (input.charCodeAt(peg$currPos) === 60) {
805
+ s4 = peg$c3;
714
806
  peg$currPos++;
715
807
  } else {
716
- s8 = peg$FAILED;
808
+ s4 = peg$FAILED;
717
809
  if (peg$silentFails === 0) { peg$fail(peg$e3); }
718
810
  }
719
- if (s8 !== peg$FAILED) {
720
- s2 = s6;
811
+ if (s4 !== peg$FAILED) {
812
+ s5 = peg$parse_();
813
+ s6 = peg$parseTypeArgList();
814
+ if (s6 !== peg$FAILED) {
815
+ s7 = peg$parse_();
816
+ if (input.charCodeAt(peg$currPos) === 62) {
817
+ s8 = peg$c4;
818
+ peg$currPos++;
819
+ } else {
820
+ s8 = peg$FAILED;
821
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
822
+ }
823
+ if (s8 !== peg$FAILED) {
824
+ s2 = s6;
825
+ } else {
826
+ peg$currPos = s2;
827
+ s2 = peg$FAILED;
828
+ }
829
+ } else {
830
+ peg$currPos = s2;
831
+ s2 = peg$FAILED;
832
+ }
721
833
  } else {
722
834
  peg$currPos = s2;
723
835
  s2 = peg$FAILED;
724
836
  }
837
+ if (s2 === peg$FAILED) {
838
+ s2 = null;
839
+ }
840
+ peg$savedPos = s0;
841
+ s0 = peg$f3(s1, s2);
725
842
  } else {
726
- peg$currPos = s2;
727
- s2 = peg$FAILED;
728
- }
729
- } else {
730
- peg$currPos = s2;
731
- s2 = peg$FAILED;
732
- }
733
- if (s2 === peg$FAILED) {
734
- s2 = null;
735
- }
736
- peg$savedPos = s0;
737
- s0 = peg$f2(s1, s2);
738
- } else {
739
- peg$currPos = s0;
740
- s0 = peg$FAILED;
741
- }
742
- if (s0 === peg$FAILED) {
743
- s0 = peg$currPos;
744
- s1 = peg$parseString();
745
- if (s1 !== peg$FAILED) {
746
- peg$savedPos = s0;
747
- s1 = peg$f3(s1);
748
- }
749
- s0 = s1;
750
- if (s0 === peg$FAILED) {
751
- s0 = peg$currPos;
752
- if (input.charCodeAt(peg$currPos) === 40) {
753
- s1 = peg$c4;
754
- peg$currPos++;
755
- } else {
756
- s1 = peg$FAILED;
757
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
843
+ peg$currPos = s0;
844
+ s0 = peg$FAILED;
758
845
  }
759
- if (s1 !== peg$FAILED) {
760
- s2 = peg$parse_();
761
- s3 = peg$parseUnionType();
762
- if (s3 !== peg$FAILED) {
763
- s4 = peg$parse_();
764
- if (input.charCodeAt(peg$currPos) === 41) {
765
- s5 = peg$c5;
846
+ if (s0 === peg$FAILED) {
847
+ s0 = peg$currPos;
848
+ s1 = peg$parseString();
849
+ if (s1 !== peg$FAILED) {
850
+ peg$savedPos = s0;
851
+ s1 = peg$f4(s1);
852
+ }
853
+ s0 = s1;
854
+ if (s0 === peg$FAILED) {
855
+ s0 = peg$currPos;
856
+ if (input.charCodeAt(peg$currPos) === 40) {
857
+ s1 = peg$c5;
766
858
  peg$currPos++;
767
859
  } else {
768
- s5 = peg$FAILED;
860
+ s1 = peg$FAILED;
769
861
  if (peg$silentFails === 0) { peg$fail(peg$e5); }
770
862
  }
771
- if (s5 !== peg$FAILED) {
772
- s0 = s3;
863
+ if (s1 !== peg$FAILED) {
864
+ s2 = peg$parse_();
865
+ s3 = peg$parseUnionType();
866
+ if (s3 !== peg$FAILED) {
867
+ s4 = peg$parse_();
868
+ if (input.charCodeAt(peg$currPos) === 41) {
869
+ s5 = peg$c6;
870
+ peg$currPos++;
871
+ } else {
872
+ s5 = peg$FAILED;
873
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
874
+ }
875
+ if (s5 !== peg$FAILED) {
876
+ s0 = s3;
877
+ } else {
878
+ peg$currPos = s0;
879
+ s0 = peg$FAILED;
880
+ }
881
+ } else {
882
+ peg$currPos = s0;
883
+ s0 = peg$FAILED;
884
+ }
773
885
  } else {
774
886
  peg$currPos = s0;
775
887
  s0 = peg$FAILED;
776
888
  }
777
- } else {
778
- peg$currPos = s0;
779
- s0 = peg$FAILED;
889
+ if (s0 === peg$FAILED) {
890
+ s0 = peg$parseRecordType();
891
+ }
780
892
  }
893
+ }
894
+ }
895
+ }
896
+ }
897
+
898
+ return s0;
899
+ }
900
+
901
+ function peg$parseReflectionType() {
902
+ let s0, s1, s2, s3, s4, s5, s6, s7;
903
+
904
+ s0 = peg$currPos;
905
+ if (input.substr(peg$currPos, 4) === peg$c7) {
906
+ s1 = peg$c7;
907
+ peg$currPos += 4;
908
+ } else {
909
+ s1 = peg$FAILED;
910
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
911
+ }
912
+ if (s1 !== peg$FAILED) {
913
+ s2 = peg$parse_();
914
+ if (input.charCodeAt(peg$currPos) === 40) {
915
+ s3 = peg$c5;
916
+ peg$currPos++;
917
+ } else {
918
+ s3 = peg$FAILED;
919
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
920
+ }
921
+ if (s3 !== peg$FAILED) {
922
+ s4 = peg$parse_();
923
+ s5 = peg$parseIdentifier();
924
+ if (s5 !== peg$FAILED) {
925
+ s6 = peg$parse_();
926
+ if (input.charCodeAt(peg$currPos) === 41) {
927
+ s7 = peg$c6;
928
+ peg$currPos++;
929
+ } else {
930
+ s7 = peg$FAILED;
931
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
932
+ }
933
+ if (s7 !== peg$FAILED) {
934
+ peg$savedPos = s0;
935
+ s0 = peg$f5(s5);
781
936
  } else {
782
937
  peg$currPos = s0;
783
938
  s0 = peg$FAILED;
784
939
  }
785
- if (s0 === peg$FAILED) {
786
- s0 = peg$parseRecordType();
787
- }
940
+ } else {
941
+ peg$currPos = s0;
942
+ s0 = peg$FAILED;
788
943
  }
944
+ } else {
945
+ peg$currPos = s0;
946
+ s0 = peg$FAILED;
789
947
  }
948
+ } else {
949
+ peg$currPos = s0;
950
+ s0 = peg$FAILED;
951
+ }
952
+
953
+ return s0;
954
+ }
955
+
956
+ function peg$parseTupleType() {
957
+ let s0, s1, s2, s3, s4, s5;
958
+
959
+ s0 = peg$currPos;
960
+ if (input.charCodeAt(peg$currPos) === 91) {
961
+ s1 = peg$c8;
962
+ peg$currPos++;
963
+ } else {
964
+ s1 = peg$FAILED;
965
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
966
+ }
967
+ if (s1 !== peg$FAILED) {
968
+ s2 = peg$parse_();
969
+ s3 = peg$parseTupleElementList();
970
+ if (s3 === peg$FAILED) {
971
+ s3 = null;
972
+ }
973
+ s4 = peg$parse_();
974
+ if (input.charCodeAt(peg$currPos) === 93) {
975
+ s5 = peg$c9;
976
+ peg$currPos++;
977
+ } else {
978
+ s5 = peg$FAILED;
979
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
980
+ }
981
+ if (s5 !== peg$FAILED) {
982
+ peg$savedPos = s0;
983
+ s0 = peg$f6(s3);
984
+ } else {
985
+ peg$currPos = s0;
986
+ s0 = peg$FAILED;
987
+ }
988
+ } else {
989
+ peg$currPos = s0;
990
+ s0 = peg$FAILED;
991
+ }
992
+
993
+ return s0;
994
+ }
995
+
996
+ function peg$parseTupleElementList() {
997
+ let s0, s1, s2, s3, s4, s5, s6, s7;
998
+
999
+ s0 = peg$currPos;
1000
+ s1 = peg$currPos;
1001
+ s2 = [];
1002
+ s3 = peg$parseTupleElement();
1003
+ while (s3 !== peg$FAILED) {
1004
+ s2.push(s3);
1005
+ s3 = peg$currPos;
1006
+ s4 = peg$currPos;
1007
+ s5 = peg$parse_();
1008
+ if (input.charCodeAt(peg$currPos) === 44) {
1009
+ s6 = peg$c10;
1010
+ peg$currPos++;
1011
+ } else {
1012
+ s6 = peg$FAILED;
1013
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1014
+ }
1015
+ if (s6 !== peg$FAILED) {
1016
+ s7 = peg$parse_();
1017
+ s5 = [s5, s6, s7];
1018
+ s4 = s5;
1019
+ } else {
1020
+ peg$currPos = s4;
1021
+ s4 = peg$FAILED;
1022
+ }
1023
+ if (s4 !== peg$FAILED) {
1024
+ s4 = peg$parseTupleElement();
1025
+ if (s4 === peg$FAILED) {
1026
+ peg$currPos = s3;
1027
+ s3 = peg$FAILED;
1028
+ } else {
1029
+ s3 = s4;
1030
+ }
1031
+ } else {
1032
+ s3 = s4;
1033
+ }
1034
+ }
1035
+ if (s2.length < 1) {
1036
+ peg$currPos = s1;
1037
+ s1 = peg$FAILED;
1038
+ } else {
1039
+ s1 = s2;
1040
+ }
1041
+ if (s1 !== peg$FAILED) {
1042
+ s2 = peg$currPos;
1043
+ s3 = peg$parse_();
1044
+ if (input.charCodeAt(peg$currPos) === 44) {
1045
+ s4 = peg$c10;
1046
+ peg$currPos++;
1047
+ } else {
1048
+ s4 = peg$FAILED;
1049
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1050
+ }
1051
+ if (s4 !== peg$FAILED) {
1052
+ s5 = peg$parse_();
1053
+ s3 = [s3, s4, s5];
1054
+ s2 = s3;
1055
+ } else {
1056
+ peg$currPos = s2;
1057
+ s2 = peg$FAILED;
1058
+ }
1059
+ if (s2 === peg$FAILED) {
1060
+ s2 = null;
1061
+ }
1062
+ s0 = s1;
1063
+ } else {
1064
+ peg$currPos = s0;
1065
+ s0 = peg$FAILED;
1066
+ }
1067
+
1068
+ return s0;
1069
+ }
1070
+
1071
+ function peg$parseTupleElement() {
1072
+ let s0, s1, s2, s3;
1073
+
1074
+ s0 = peg$currPos;
1075
+ if (input.substr(peg$currPos, 2) === peg$c11) {
1076
+ s1 = peg$c11;
1077
+ peg$currPos += 2;
1078
+ } else {
1079
+ s1 = peg$FAILED;
1080
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1081
+ }
1082
+ if (s1 === peg$FAILED) {
1083
+ s1 = null;
1084
+ }
1085
+ s2 = peg$parse_();
1086
+ s3 = peg$parseUnionType();
1087
+ if (s3 !== peg$FAILED) {
1088
+ peg$savedPos = s0;
1089
+ s0 = peg$f7(s1, s3);
1090
+ } else {
1091
+ peg$currPos = s0;
1092
+ s0 = peg$FAILED;
790
1093
  }
791
1094
 
792
1095
  return s0;
@@ -805,11 +1108,11 @@ function peg$parse(input, options) {
805
1108
  s4 = peg$currPos;
806
1109
  s5 = peg$parse_();
807
1110
  if (input.charCodeAt(peg$currPos) === 44) {
808
- s6 = peg$c6;
1111
+ s6 = peg$c10;
809
1112
  peg$currPos++;
810
1113
  } else {
811
1114
  s6 = peg$FAILED;
812
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1115
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
813
1116
  }
814
1117
  if (s6 !== peg$FAILED) {
815
1118
  s7 = peg$parse_();
@@ -841,11 +1144,11 @@ function peg$parse(input, options) {
841
1144
  s2 = peg$currPos;
842
1145
  s3 = peg$parse_();
843
1146
  if (input.charCodeAt(peg$currPos) === 44) {
844
- s4 = peg$c6;
1147
+ s4 = peg$c10;
845
1148
  peg$currPos++;
846
1149
  } else {
847
1150
  s4 = peg$FAILED;
848
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1151
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
849
1152
  }
850
1153
  if (s4 !== peg$FAILED) {
851
1154
  s5 = peg$parse_();
@@ -880,11 +1183,11 @@ function peg$parse(input, options) {
880
1183
  s4 = peg$currPos;
881
1184
  s5 = peg$parse_();
882
1185
  if (input.charCodeAt(peg$currPos) === 44) {
883
- s6 = peg$c6;
1186
+ s6 = peg$c10;
884
1187
  peg$currPos++;
885
1188
  } else {
886
1189
  s6 = peg$FAILED;
887
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1190
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
888
1191
  }
889
1192
  if (s6 !== peg$FAILED) {
890
1193
  s7 = peg$parse_();
@@ -916,11 +1219,11 @@ function peg$parse(input, options) {
916
1219
  s2 = peg$currPos;
917
1220
  s3 = peg$parse_();
918
1221
  if (input.charCodeAt(peg$currPos) === 44) {
919
- s4 = peg$c6;
1222
+ s4 = peg$c10;
920
1223
  peg$currPos++;
921
1224
  } else {
922
1225
  s4 = peg$FAILED;
923
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1226
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
924
1227
  }
925
1228
  if (s4 !== peg$FAILED) {
926
1229
  s5 = peg$parse_();
@@ -946,19 +1249,19 @@ function peg$parse(input, options) {
946
1249
  let s0, s1, s2, s3;
947
1250
 
948
1251
  s0 = peg$currPos;
949
- if (input.substr(peg$currPos, 2) === peg$c7) {
950
- s1 = peg$c7;
1252
+ if (input.substr(peg$currPos, 2) === peg$c12) {
1253
+ s1 = peg$c12;
951
1254
  peg$currPos += 2;
952
1255
  } else {
953
1256
  s1 = peg$FAILED;
954
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
1257
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
955
1258
  }
956
1259
  if (s1 !== peg$FAILED) {
957
1260
  s2 = peg$parse_();
958
1261
  s3 = peg$parseFunctionBody();
959
1262
  if (s3 !== peg$FAILED) {
960
1263
  peg$savedPos = s0;
961
- s0 = peg$f4(s3);
1264
+ s0 = peg$f8(s3);
962
1265
  } else {
963
1266
  peg$currPos = s0;
964
1267
  s0 = peg$FAILED;
@@ -975,12 +1278,12 @@ function peg$parse(input, options) {
975
1278
  let s0, s1, s2, s3, s4, s5;
976
1279
 
977
1280
  s0 = peg$currPos;
978
- if (input.substr(peg$currPos, 2) === peg$c7) {
979
- s1 = peg$c7;
1281
+ if (input.substr(peg$currPos, 2) === peg$c12) {
1282
+ s1 = peg$c12;
980
1283
  peg$currPos += 2;
981
1284
  } else {
982
1285
  s1 = peg$FAILED;
983
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
1286
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
984
1287
  }
985
1288
  if (s1 !== peg$FAILED) {
986
1289
  s2 = peg$parse_();
@@ -990,7 +1293,7 @@ function peg$parse(input, options) {
990
1293
  s5 = peg$parseFunctionBody();
991
1294
  if (s5 !== peg$FAILED) {
992
1295
  peg$savedPos = s0;
993
- s0 = peg$f5(s3, s5);
1296
+ s0 = peg$f9(s3, s5);
994
1297
  } else {
995
1298
  peg$currPos = s0;
996
1299
  s0 = peg$FAILED;
@@ -1014,11 +1317,11 @@ function peg$parse(input, options) {
1014
1317
  s1 = peg$currPos;
1015
1318
  s2 = peg$parse_();
1016
1319
  if (input.charCodeAt(peg$currPos) === 60) {
1017
- s3 = peg$c2;
1320
+ s3 = peg$c3;
1018
1321
  peg$currPos++;
1019
1322
  } else {
1020
1323
  s3 = peg$FAILED;
1021
- if (peg$silentFails === 0) { peg$fail(peg$e2); }
1324
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
1022
1325
  }
1023
1326
  if (s3 !== peg$FAILED) {
1024
1327
  s4 = peg$parse_();
@@ -1026,11 +1329,11 @@ function peg$parse(input, options) {
1026
1329
  if (s5 !== peg$FAILED) {
1027
1330
  s6 = peg$parse_();
1028
1331
  if (input.charCodeAt(peg$currPos) === 62) {
1029
- s7 = peg$c3;
1332
+ s7 = peg$c4;
1030
1333
  peg$currPos++;
1031
1334
  } else {
1032
1335
  s7 = peg$FAILED;
1033
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
1336
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
1034
1337
  }
1035
1338
  if (s7 !== peg$FAILED) {
1036
1339
  s1 = s5;
@@ -1051,11 +1354,11 @@ function peg$parse(input, options) {
1051
1354
  }
1052
1355
  s2 = peg$parse_();
1053
1356
  if (input.charCodeAt(peg$currPos) === 40) {
1054
- s3 = peg$c4;
1357
+ s3 = peg$c5;
1055
1358
  peg$currPos++;
1056
1359
  } else {
1057
1360
  s3 = peg$FAILED;
1058
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
1361
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1059
1362
  }
1060
1363
  if (s3 !== peg$FAILED) {
1061
1364
  s4 = peg$parse_();
@@ -1065,21 +1368,21 @@ function peg$parse(input, options) {
1065
1368
  }
1066
1369
  s6 = peg$parse_();
1067
1370
  if (input.charCodeAt(peg$currPos) === 41) {
1068
- s7 = peg$c5;
1371
+ s7 = peg$c6;
1069
1372
  peg$currPos++;
1070
1373
  } else {
1071
1374
  s7 = peg$FAILED;
1072
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
1375
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
1073
1376
  }
1074
1377
  if (s7 !== peg$FAILED) {
1075
1378
  s8 = peg$currPos;
1076
1379
  s9 = peg$parse_();
1077
- if (input.substr(peg$currPos, 2) === peg$c8) {
1078
- s10 = peg$c8;
1380
+ if (input.substr(peg$currPos, 2) === peg$c13) {
1381
+ s10 = peg$c13;
1079
1382
  peg$currPos += 2;
1080
1383
  } else {
1081
1384
  s10 = peg$FAILED;
1082
- if (peg$silentFails === 0) { peg$fail(peg$e8); }
1385
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1083
1386
  }
1084
1387
  if (s10 !== peg$FAILED) {
1085
1388
  s11 = peg$parse_();
@@ -1098,7 +1401,7 @@ function peg$parse(input, options) {
1098
1401
  s8 = null;
1099
1402
  }
1100
1403
  peg$savedPos = s0;
1101
- s0 = peg$f6(s1, s5, s8);
1404
+ s0 = peg$f10(s1, s5, s8);
1102
1405
  } else {
1103
1406
  peg$currPos = s0;
1104
1407
  s0 = peg$FAILED;
@@ -1124,11 +1427,11 @@ function peg$parse(input, options) {
1124
1427
  s4 = peg$currPos;
1125
1428
  s5 = peg$parse_();
1126
1429
  if (input.charCodeAt(peg$currPos) === 44) {
1127
- s6 = peg$c6;
1430
+ s6 = peg$c10;
1128
1431
  peg$currPos++;
1129
1432
  } else {
1130
1433
  s6 = peg$FAILED;
1131
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1434
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1132
1435
  }
1133
1436
  if (s6 !== peg$FAILED) {
1134
1437
  s7 = peg$parse_();
@@ -1160,11 +1463,11 @@ function peg$parse(input, options) {
1160
1463
  s2 = peg$currPos;
1161
1464
  s3 = peg$parse_();
1162
1465
  if (input.charCodeAt(peg$currPos) === 44) {
1163
- s4 = peg$c6;
1466
+ s4 = peg$c10;
1164
1467
  peg$currPos++;
1165
1468
  } else {
1166
1469
  s4 = peg$FAILED;
1167
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1470
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1168
1471
  }
1169
1472
  if (s4 !== peg$FAILED) {
1170
1473
  s5 = peg$parse_();
@@ -1178,7 +1481,7 @@ function peg$parse(input, options) {
1178
1481
  s2 = null;
1179
1482
  }
1180
1483
  peg$savedPos = s0;
1181
- s0 = peg$f7(s1);
1484
+ s0 = peg$f11(s1);
1182
1485
  } else {
1183
1486
  peg$currPos = s0;
1184
1487
  s0 = peg$FAILED;
@@ -1191,12 +1494,12 @@ function peg$parse(input, options) {
1191
1494
  let s0, s1, s2, s3, s4, s5, s6, s7;
1192
1495
 
1193
1496
  s0 = peg$currPos;
1194
- if (input.substr(peg$currPos, 2) === peg$c9) {
1195
- s1 = peg$c9;
1497
+ if (input.substr(peg$currPos, 2) === peg$c11) {
1498
+ s1 = peg$c11;
1196
1499
  peg$currPos += 2;
1197
1500
  } else {
1198
1501
  s1 = peg$FAILED;
1199
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
1502
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1200
1503
  }
1201
1504
  if (s1 !== peg$FAILED) {
1202
1505
  s2 = peg$parseIdentifier();
@@ -1206,11 +1509,11 @@ function peg$parse(input, options) {
1206
1509
  s3 = peg$parse_();
1207
1510
  s4 = peg$currPos;
1208
1511
  if (input.charCodeAt(peg$currPos) === 58) {
1209
- s5 = peg$c10;
1512
+ s5 = peg$c14;
1210
1513
  peg$currPos++;
1211
1514
  } else {
1212
1515
  s5 = peg$FAILED;
1213
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
1516
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1214
1517
  }
1215
1518
  if (s5 !== peg$FAILED) {
1216
1519
  s6 = peg$parse_();
@@ -1229,7 +1532,7 @@ function peg$parse(input, options) {
1229
1532
  s4 = null;
1230
1533
  }
1231
1534
  peg$savedPos = s0;
1232
- s0 = peg$f8(s1, s2, s4);
1535
+ s0 = peg$f12(s1, s2, s4);
1233
1536
  } else {
1234
1537
  peg$currPos = s0;
1235
1538
  s0 = peg$FAILED;
@@ -1241,11 +1544,11 @@ function peg$parse(input, options) {
1241
1544
  s2 = peg$parse_();
1242
1545
  s3 = peg$currPos;
1243
1546
  if (input.charCodeAt(peg$currPos) === 58) {
1244
- s4 = peg$c10;
1547
+ s4 = peg$c14;
1245
1548
  peg$currPos++;
1246
1549
  } else {
1247
1550
  s4 = peg$FAILED;
1248
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
1551
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1249
1552
  }
1250
1553
  if (s4 !== peg$FAILED) {
1251
1554
  s5 = peg$parse_();
@@ -1264,7 +1567,7 @@ function peg$parse(input, options) {
1264
1567
  s3 = null;
1265
1568
  }
1266
1569
  peg$savedPos = s0;
1267
- s0 = peg$f9(s1, s3);
1570
+ s0 = peg$f13(s1, s3);
1268
1571
  } else {
1269
1572
  peg$currPos = s0;
1270
1573
  s0 = peg$FAILED;
@@ -1279,11 +1582,11 @@ function peg$parse(input, options) {
1279
1582
 
1280
1583
  s0 = peg$currPos;
1281
1584
  if (input.charCodeAt(peg$currPos) === 40) {
1282
- s1 = peg$c4;
1585
+ s1 = peg$c5;
1283
1586
  peg$currPos++;
1284
1587
  } else {
1285
1588
  s1 = peg$FAILED;
1286
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
1589
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1287
1590
  }
1288
1591
  if (s1 !== peg$FAILED) {
1289
1592
  s2 = peg$parse_();
@@ -1293,15 +1596,15 @@ function peg$parse(input, options) {
1293
1596
  }
1294
1597
  s4 = peg$parse_();
1295
1598
  if (input.charCodeAt(peg$currPos) === 41) {
1296
- s5 = peg$c5;
1599
+ s5 = peg$c6;
1297
1600
  peg$currPos++;
1298
1601
  } else {
1299
1602
  s5 = peg$FAILED;
1300
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
1603
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
1301
1604
  }
1302
1605
  if (s5 !== peg$FAILED) {
1303
1606
  peg$savedPos = s0;
1304
- s0 = peg$f10(s3);
1607
+ s0 = peg$f14(s3);
1305
1608
  } else {
1306
1609
  peg$currPos = s0;
1307
1610
  s0 = peg$FAILED;
@@ -1327,11 +1630,11 @@ function peg$parse(input, options) {
1327
1630
  s4 = peg$currPos;
1328
1631
  s5 = peg$parse_();
1329
1632
  if (input.charCodeAt(peg$currPos) === 44) {
1330
- s6 = peg$c6;
1633
+ s6 = peg$c10;
1331
1634
  peg$currPos++;
1332
1635
  } else {
1333
1636
  s6 = peg$FAILED;
1334
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1637
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1335
1638
  }
1336
1639
  if (s6 !== peg$FAILED) {
1337
1640
  s7 = peg$parse_();
@@ -1363,11 +1666,11 @@ function peg$parse(input, options) {
1363
1666
  s2 = peg$currPos;
1364
1667
  s3 = peg$parse_();
1365
1668
  if (input.charCodeAt(peg$currPos) === 44) {
1366
- s4 = peg$c6;
1669
+ s4 = peg$c10;
1367
1670
  peg$currPos++;
1368
1671
  } else {
1369
1672
  s4 = peg$FAILED;
1370
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1673
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1371
1674
  }
1372
1675
  if (s4 !== peg$FAILED) {
1373
1676
  s5 = peg$parse_();
@@ -1396,29 +1699,29 @@ function peg$parse(input, options) {
1396
1699
  s1 = peg$parseFieldName();
1397
1700
  if (s1 !== peg$FAILED) {
1398
1701
  if (input.charCodeAt(peg$currPos) === 63) {
1399
- s2 = peg$c11;
1702
+ s2 = peg$c15;
1400
1703
  peg$currPos++;
1401
1704
  } else {
1402
1705
  s2 = peg$FAILED;
1403
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1706
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
1404
1707
  }
1405
1708
  if (s2 === peg$FAILED) {
1406
1709
  s2 = null;
1407
1710
  }
1408
1711
  s3 = peg$parse_();
1409
1712
  if (input.charCodeAt(peg$currPos) === 58) {
1410
- s4 = peg$c10;
1713
+ s4 = peg$c14;
1411
1714
  peg$currPos++;
1412
1715
  } else {
1413
1716
  s4 = peg$FAILED;
1414
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
1717
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1415
1718
  }
1416
1719
  if (s4 !== peg$FAILED) {
1417
1720
  s5 = peg$parse_();
1418
1721
  s6 = peg$parseUnionType();
1419
1722
  if (s6 !== peg$FAILED) {
1420
1723
  peg$savedPos = s0;
1421
- s0 = peg$f11(s1, s2, s6);
1724
+ s0 = peg$f15(s1, s2, s6);
1422
1725
  } else {
1423
1726
  peg$currPos = s0;
1424
1727
  s0 = peg$FAILED;
@@ -1436,7 +1739,7 @@ function peg$parse(input, options) {
1436
1739
  s1 = peg$parseUnionType();
1437
1740
  if (s1 !== peg$FAILED) {
1438
1741
  peg$savedPos = s0;
1439
- s1 = peg$f12(s1);
1742
+ s1 = peg$f16(s1);
1440
1743
  }
1441
1744
  s0 = s1;
1442
1745
  }
@@ -1453,7 +1756,7 @@ function peg$parse(input, options) {
1453
1756
  s1 = peg$parseString();
1454
1757
  if (s1 !== peg$FAILED) {
1455
1758
  peg$savedPos = s0;
1456
- s1 = peg$f13(s1);
1759
+ s1 = peg$f17(s1);
1457
1760
  }
1458
1761
  s0 = s1;
1459
1762
  }
@@ -1470,12 +1773,12 @@ function peg$parse(input, options) {
1470
1773
  peg$currPos++;
1471
1774
  } else {
1472
1775
  s0 = peg$FAILED;
1473
- if (peg$silentFails === 0) { peg$fail(peg$e13); }
1776
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1474
1777
  }
1475
1778
  peg$silentFails--;
1476
1779
  if (s0 === peg$FAILED) {
1477
1780
  s1 = peg$FAILED;
1478
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1781
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1479
1782
  }
1480
1783
 
1481
1784
  return s0;
@@ -1486,11 +1789,11 @@ function peg$parse(input, options) {
1486
1789
 
1487
1790
  s0 = peg$currPos;
1488
1791
  if (input.charCodeAt(peg$currPos) === 92) {
1489
- s1 = peg$c12;
1792
+ s1 = peg$c16;
1490
1793
  peg$currPos++;
1491
1794
  } else {
1492
1795
  s1 = peg$FAILED;
1493
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1796
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1494
1797
  }
1495
1798
  if (s1 !== peg$FAILED) {
1496
1799
  s2 = input.charAt(peg$currPos);
@@ -1498,11 +1801,11 @@ function peg$parse(input, options) {
1498
1801
  peg$currPos++;
1499
1802
  } else {
1500
1803
  s2 = peg$FAILED;
1501
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1804
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1502
1805
  }
1503
1806
  if (s2 !== peg$FAILED) {
1504
1807
  peg$savedPos = s0;
1505
- s0 = peg$f14(s2);
1808
+ s0 = peg$f18(s2);
1506
1809
  } else {
1507
1810
  peg$currPos = s0;
1508
1811
  s0 = peg$FAILED;
@@ -1513,12 +1816,12 @@ function peg$parse(input, options) {
1513
1816
  }
1514
1817
  if (s0 === peg$FAILED) {
1515
1818
  s0 = peg$currPos;
1516
- if (input.substr(peg$currPos, 2) === peg$c13) {
1517
- s1 = peg$c13;
1819
+ if (input.substr(peg$currPos, 2) === peg$c17) {
1820
+ s1 = peg$c17;
1518
1821
  peg$currPos += 2;
1519
1822
  } else {
1520
1823
  s1 = peg$FAILED;
1521
- if (peg$silentFails === 0) { peg$fail(peg$e16); }
1824
+ if (peg$silentFails === 0) { peg$fail(peg$e20); }
1522
1825
  }
1523
1826
  if (s1 !== peg$FAILED) {
1524
1827
  s2 = peg$currPos;
@@ -1544,7 +1847,7 @@ function peg$parse(input, options) {
1544
1847
  }
1545
1848
  if (s2 !== peg$FAILED) {
1546
1849
  peg$savedPos = s0;
1547
- s0 = peg$f15(s2);
1850
+ s0 = peg$f19(s2);
1548
1851
  } else {
1549
1852
  peg$currPos = s0;
1550
1853
  s0 = peg$FAILED;
@@ -1555,12 +1858,12 @@ function peg$parse(input, options) {
1555
1858
  }
1556
1859
  if (s0 === peg$FAILED) {
1557
1860
  s0 = peg$currPos;
1558
- if (input.substr(peg$currPos, 3) === peg$c14) {
1559
- s1 = peg$c14;
1861
+ if (input.substr(peg$currPos, 3) === peg$c18) {
1862
+ s1 = peg$c18;
1560
1863
  peg$currPos += 3;
1561
1864
  } else {
1562
1865
  s1 = peg$FAILED;
1563
- if (peg$silentFails === 0) { peg$fail(peg$e17); }
1866
+ if (peg$silentFails === 0) { peg$fail(peg$e21); }
1564
1867
  }
1565
1868
  if (s1 !== peg$FAILED) {
1566
1869
  s2 = peg$currPos;
@@ -1581,15 +1884,15 @@ function peg$parse(input, options) {
1581
1884
  }
1582
1885
  if (s2 !== peg$FAILED) {
1583
1886
  if (input.charCodeAt(peg$currPos) === 125) {
1584
- s3 = peg$c15;
1887
+ s3 = peg$c19;
1585
1888
  peg$currPos++;
1586
1889
  } else {
1587
1890
  s3 = peg$FAILED;
1588
- if (peg$silentFails === 0) { peg$fail(peg$e18); }
1891
+ if (peg$silentFails === 0) { peg$fail(peg$e22); }
1589
1892
  }
1590
1893
  if (s3 !== peg$FAILED) {
1591
1894
  peg$savedPos = s0;
1592
- s0 = peg$f16(s2);
1895
+ s0 = peg$f20(s2);
1593
1896
  } else {
1594
1897
  peg$currPos = s0;
1595
1898
  s0 = peg$FAILED;
@@ -1614,11 +1917,11 @@ function peg$parse(input, options) {
1614
1917
  peg$silentFails++;
1615
1918
  s0 = peg$currPos;
1616
1919
  if (input.charCodeAt(peg$currPos) === 34) {
1617
- s1 = peg$c16;
1920
+ s1 = peg$c20;
1618
1921
  peg$currPos++;
1619
1922
  } else {
1620
1923
  s1 = peg$FAILED;
1621
- if (peg$silentFails === 0) { peg$fail(peg$e20); }
1924
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1622
1925
  }
1623
1926
  if (s1 !== peg$FAILED) {
1624
1927
  s2 = [];
@@ -1628,15 +1931,15 @@ function peg$parse(input, options) {
1628
1931
  s3 = peg$parseDoubleQuotePart();
1629
1932
  }
1630
1933
  if (input.charCodeAt(peg$currPos) === 34) {
1631
- s3 = peg$c16;
1934
+ s3 = peg$c20;
1632
1935
  peg$currPos++;
1633
1936
  } else {
1634
1937
  s3 = peg$FAILED;
1635
- if (peg$silentFails === 0) { peg$fail(peg$e20); }
1938
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1636
1939
  }
1637
1940
  if (s3 !== peg$FAILED) {
1638
1941
  peg$savedPos = s0;
1639
- s0 = peg$f17(s2);
1942
+ s0 = peg$f21(s2);
1640
1943
  } else {
1641
1944
  peg$currPos = s0;
1642
1945
  s0 = peg$FAILED;
@@ -1648,11 +1951,11 @@ function peg$parse(input, options) {
1648
1951
  if (s0 === peg$FAILED) {
1649
1952
  s0 = peg$currPos;
1650
1953
  if (input.charCodeAt(peg$currPos) === 39) {
1651
- s1 = peg$c17;
1954
+ s1 = peg$c21;
1652
1955
  peg$currPos++;
1653
1956
  } else {
1654
1957
  s1 = peg$FAILED;
1655
- if (peg$silentFails === 0) { peg$fail(peg$e21); }
1958
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1656
1959
  }
1657
1960
  if (s1 !== peg$FAILED) {
1658
1961
  s2 = [];
@@ -1662,15 +1965,15 @@ function peg$parse(input, options) {
1662
1965
  s3 = peg$parseSingleQuotePart();
1663
1966
  }
1664
1967
  if (input.charCodeAt(peg$currPos) === 39) {
1665
- s3 = peg$c17;
1968
+ s3 = peg$c21;
1666
1969
  peg$currPos++;
1667
1970
  } else {
1668
1971
  s3 = peg$FAILED;
1669
- if (peg$silentFails === 0) { peg$fail(peg$e21); }
1972
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1670
1973
  }
1671
1974
  if (s3 !== peg$FAILED) {
1672
1975
  peg$savedPos = s0;
1673
- s0 = peg$f18(s2);
1976
+ s0 = peg$f22(s2);
1674
1977
  } else {
1675
1978
  peg$currPos = s0;
1676
1979
  s0 = peg$FAILED;
@@ -1682,11 +1985,11 @@ function peg$parse(input, options) {
1682
1985
  if (s0 === peg$FAILED) {
1683
1986
  s0 = peg$currPos;
1684
1987
  if (input.charCodeAt(peg$currPos) === 96) {
1685
- s1 = peg$c18;
1988
+ s1 = peg$c22;
1686
1989
  peg$currPos++;
1687
1990
  } else {
1688
1991
  s1 = peg$FAILED;
1689
- if (peg$silentFails === 0) { peg$fail(peg$e22); }
1992
+ if (peg$silentFails === 0) { peg$fail(peg$e26); }
1690
1993
  }
1691
1994
  if (s1 !== peg$FAILED) {
1692
1995
  s2 = [];
@@ -1696,15 +1999,15 @@ function peg$parse(input, options) {
1696
1999
  s3 = peg$parseBacktickPart();
1697
2000
  }
1698
2001
  if (input.charCodeAt(peg$currPos) === 96) {
1699
- s3 = peg$c18;
2002
+ s3 = peg$c22;
1700
2003
  peg$currPos++;
1701
2004
  } else {
1702
2005
  s3 = peg$FAILED;
1703
- if (peg$silentFails === 0) { peg$fail(peg$e22); }
2006
+ if (peg$silentFails === 0) { peg$fail(peg$e26); }
1704
2007
  }
1705
2008
  if (s3 !== peg$FAILED) {
1706
2009
  peg$savedPos = s0;
1707
- s0 = peg$f19(s2);
2010
+ s0 = peg$f23(s2);
1708
2011
  } else {
1709
2012
  peg$currPos = s0;
1710
2013
  s0 = peg$FAILED;
@@ -1718,7 +2021,7 @@ function peg$parse(input, options) {
1718
2021
  peg$silentFails--;
1719
2022
  if (s0 === peg$FAILED) {
1720
2023
  s1 = peg$FAILED;
1721
- if (peg$silentFails === 0) { peg$fail(peg$e19); }
2024
+ if (peg$silentFails === 0) { peg$fail(peg$e23); }
1722
2025
  }
1723
2026
 
1724
2027
  return s0;
@@ -1729,19 +2032,19 @@ function peg$parse(input, options) {
1729
2032
 
1730
2033
  s0 = peg$currPos;
1731
2034
  if (input.charCodeAt(peg$currPos) === 36) {
1732
- s1 = peg$c19;
2035
+ s1 = peg$c23;
1733
2036
  peg$currPos++;
1734
2037
  } else {
1735
2038
  s1 = peg$FAILED;
1736
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
2039
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1737
2040
  }
1738
2041
  if (s1 !== peg$FAILED) {
1739
2042
  if (input.charCodeAt(peg$currPos) === 40) {
1740
- s2 = peg$c4;
2043
+ s2 = peg$c5;
1741
2044
  peg$currPos++;
1742
2045
  } else {
1743
2046
  s2 = peg$FAILED;
1744
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
2047
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1745
2048
  }
1746
2049
  if (s2 !== peg$FAILED) {
1747
2050
  s3 = peg$parse_();
@@ -1749,11 +2052,11 @@ function peg$parse(input, options) {
1749
2052
  if (s4 !== peg$FAILED) {
1750
2053
  s5 = peg$parse_();
1751
2054
  if (input.charCodeAt(peg$currPos) === 41) {
1752
- s6 = peg$c5;
2055
+ s6 = peg$c6;
1753
2056
  peg$currPos++;
1754
2057
  } else {
1755
2058
  s6 = peg$FAILED;
1756
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
2059
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
1757
2060
  }
1758
2061
  if (s6 !== peg$FAILED) {
1759
2062
  s0 = s4;
@@ -1787,7 +2090,7 @@ function peg$parse(input, options) {
1787
2090
  }
1788
2091
  if (s1 !== peg$FAILED) {
1789
2092
  peg$savedPos = s0;
1790
- s1 = peg$f20(s1);
2093
+ s1 = peg$f24(s1);
1791
2094
  }
1792
2095
  s0 = s1;
1793
2096
  }
@@ -1800,19 +2103,19 @@ function peg$parse(input, options) {
1800
2103
 
1801
2104
  s0 = peg$currPos;
1802
2105
  if (input.charCodeAt(peg$currPos) === 36) {
1803
- s1 = peg$c19;
2106
+ s1 = peg$c23;
1804
2107
  peg$currPos++;
1805
2108
  } else {
1806
2109
  s1 = peg$FAILED;
1807
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
2110
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1808
2111
  }
1809
2112
  if (s1 !== peg$FAILED) {
1810
2113
  if (input.charCodeAt(peg$currPos) === 40) {
1811
- s2 = peg$c4;
2114
+ s2 = peg$c5;
1812
2115
  peg$currPos++;
1813
2116
  } else {
1814
2117
  s2 = peg$FAILED;
1815
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
2118
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1816
2119
  }
1817
2120
  if (s2 !== peg$FAILED) {
1818
2121
  s3 = peg$parse_();
@@ -1820,11 +2123,11 @@ function peg$parse(input, options) {
1820
2123
  if (s4 !== peg$FAILED) {
1821
2124
  s5 = peg$parse_();
1822
2125
  if (input.charCodeAt(peg$currPos) === 41) {
1823
- s6 = peg$c5;
2126
+ s6 = peg$c6;
1824
2127
  peg$currPos++;
1825
2128
  } else {
1826
2129
  s6 = peg$FAILED;
1827
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
2130
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
1828
2131
  }
1829
2132
  if (s6 !== peg$FAILED) {
1830
2133
  s0 = s4;
@@ -1858,7 +2161,7 @@ function peg$parse(input, options) {
1858
2161
  }
1859
2162
  if (s1 !== peg$FAILED) {
1860
2163
  peg$savedPos = s0;
1861
- s1 = peg$f21(s1);
2164
+ s1 = peg$f25(s1);
1862
2165
  }
1863
2166
  s0 = s1;
1864
2167
  }
@@ -1871,19 +2174,19 @@ function peg$parse(input, options) {
1871
2174
 
1872
2175
  s0 = peg$currPos;
1873
2176
  if (input.charCodeAt(peg$currPos) === 36) {
1874
- s1 = peg$c19;
2177
+ s1 = peg$c23;
1875
2178
  peg$currPos++;
1876
2179
  } else {
1877
2180
  s1 = peg$FAILED;
1878
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
2181
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1879
2182
  }
1880
2183
  if (s1 !== peg$FAILED) {
1881
2184
  if (input.charCodeAt(peg$currPos) === 40) {
1882
- s2 = peg$c4;
2185
+ s2 = peg$c5;
1883
2186
  peg$currPos++;
1884
2187
  } else {
1885
2188
  s2 = peg$FAILED;
1886
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
2189
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
1887
2190
  }
1888
2191
  if (s2 !== peg$FAILED) {
1889
2192
  s3 = peg$parse_();
@@ -1891,11 +2194,11 @@ function peg$parse(input, options) {
1891
2194
  if (s4 !== peg$FAILED) {
1892
2195
  s5 = peg$parse_();
1893
2196
  if (input.charCodeAt(peg$currPos) === 41) {
1894
- s6 = peg$c5;
2197
+ s6 = peg$c6;
1895
2198
  peg$currPos++;
1896
2199
  } else {
1897
2200
  s6 = peg$FAILED;
1898
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
2201
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
1899
2202
  }
1900
2203
  if (s6 !== peg$FAILED) {
1901
2204
  s0 = s4;
@@ -1929,7 +2232,7 @@ function peg$parse(input, options) {
1929
2232
  }
1930
2233
  if (s1 !== peg$FAILED) {
1931
2234
  peg$savedPos = s0;
1932
- s1 = peg$f22(s1);
2235
+ s1 = peg$f26(s1);
1933
2236
  }
1934
2237
  s0 = s1;
1935
2238
  }
@@ -1949,7 +2252,7 @@ function peg$parse(input, options) {
1949
2252
  peg$currPos++;
1950
2253
  } else {
1951
2254
  s2 = peg$FAILED;
1952
- if (peg$silentFails === 0) { peg$fail(peg$e24); }
2255
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1953
2256
  }
1954
2257
  if (s2 !== peg$FAILED) {
1955
2258
  while (s2 !== peg$FAILED) {
@@ -1959,7 +2262,7 @@ function peg$parse(input, options) {
1959
2262
  peg$currPos++;
1960
2263
  } else {
1961
2264
  s2 = peg$FAILED;
1962
- if (peg$silentFails === 0) { peg$fail(peg$e24); }
2265
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1963
2266
  }
1964
2267
  }
1965
2268
  } else {
@@ -1987,7 +2290,7 @@ function peg$parse(input, options) {
1987
2290
  peg$currPos++;
1988
2291
  } else {
1989
2292
  s2 = peg$FAILED;
1990
- if (peg$silentFails === 0) { peg$fail(peg$e25); }
2293
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
1991
2294
  }
1992
2295
  if (s2 !== peg$FAILED) {
1993
2296
  while (s2 !== peg$FAILED) {
@@ -1997,7 +2300,7 @@ function peg$parse(input, options) {
1997
2300
  peg$currPos++;
1998
2301
  } else {
1999
2302
  s2 = peg$FAILED;
2000
- if (peg$silentFails === 0) { peg$fail(peg$e25); }
2303
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
2001
2304
  }
2002
2305
  }
2003
2306
  } else {
@@ -2025,7 +2328,7 @@ function peg$parse(input, options) {
2025
2328
  peg$currPos++;
2026
2329
  } else {
2027
2330
  s2 = peg$FAILED;
2028
- if (peg$silentFails === 0) { peg$fail(peg$e26); }
2331
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
2029
2332
  }
2030
2333
  if (s2 !== peg$FAILED) {
2031
2334
  while (s2 !== peg$FAILED) {
@@ -2035,7 +2338,7 @@ function peg$parse(input, options) {
2035
2338
  peg$currPos++;
2036
2339
  } else {
2037
2340
  s2 = peg$FAILED;
2038
- if (peg$silentFails === 0) { peg$fail(peg$e26); }
2341
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
2039
2342
  }
2040
2343
  }
2041
2344
  } else {
@@ -2059,21 +2362,21 @@ function peg$parse(input, options) {
2059
2362
  s1 = peg$currPos;
2060
2363
  s2 = [];
2061
2364
  if (input.charCodeAt(peg$currPos) === 95) {
2062
- s3 = peg$c20;
2365
+ s3 = peg$c24;
2063
2366
  peg$currPos++;
2064
2367
  } else {
2065
2368
  s3 = peg$FAILED;
2066
- if (peg$silentFails === 0) { peg$fail(peg$e28); }
2369
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
2067
2370
  }
2068
2371
  if (s3 !== peg$FAILED) {
2069
2372
  while (s3 !== peg$FAILED) {
2070
2373
  s2.push(s3);
2071
2374
  if (input.charCodeAt(peg$currPos) === 95) {
2072
- s3 = peg$c20;
2375
+ s3 = peg$c24;
2073
2376
  peg$currPos++;
2074
2377
  } else {
2075
2378
  s3 = peg$FAILED;
2076
- if (peg$silentFails === 0) { peg$fail(peg$e28); }
2379
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
2077
2380
  }
2078
2381
  }
2079
2382
  } else {
@@ -2082,21 +2385,21 @@ function peg$parse(input, options) {
2082
2385
  if (s2 === peg$FAILED) {
2083
2386
  s2 = [];
2084
2387
  if (input.charCodeAt(peg$currPos) === 64) {
2085
- s3 = peg$c21;
2388
+ s3 = peg$c25;
2086
2389
  peg$currPos++;
2087
2390
  } else {
2088
2391
  s3 = peg$FAILED;
2089
- if (peg$silentFails === 0) { peg$fail(peg$e29); }
2392
+ if (peg$silentFails === 0) { peg$fail(peg$e33); }
2090
2393
  }
2091
2394
  if (s3 !== peg$FAILED) {
2092
2395
  while (s3 !== peg$FAILED) {
2093
2396
  s2.push(s3);
2094
2397
  if (input.charCodeAt(peg$currPos) === 64) {
2095
- s3 = peg$c21;
2398
+ s3 = peg$c25;
2096
2399
  peg$currPos++;
2097
2400
  } else {
2098
2401
  s3 = peg$FAILED;
2099
- if (peg$silentFails === 0) { peg$fail(peg$e29); }
2402
+ if (peg$silentFails === 0) { peg$fail(peg$e33); }
2100
2403
  }
2101
2404
  }
2102
2405
  } else {
@@ -2105,21 +2408,21 @@ function peg$parse(input, options) {
2105
2408
  if (s2 === peg$FAILED) {
2106
2409
  s2 = [];
2107
2410
  if (input.charCodeAt(peg$currPos) === 36) {
2108
- s3 = peg$c19;
2411
+ s3 = peg$c23;
2109
2412
  peg$currPos++;
2110
2413
  } else {
2111
2414
  s3 = peg$FAILED;
2112
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
2415
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
2113
2416
  }
2114
2417
  if (s3 !== peg$FAILED) {
2115
2418
  while (s3 !== peg$FAILED) {
2116
2419
  s2.push(s3);
2117
2420
  if (input.charCodeAt(peg$currPos) === 36) {
2118
- s3 = peg$c19;
2421
+ s3 = peg$c23;
2119
2422
  peg$currPos++;
2120
2423
  } else {
2121
2424
  s3 = peg$FAILED;
2122
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
2425
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
2123
2426
  }
2124
2427
  }
2125
2428
  } else {
@@ -2131,7 +2434,7 @@ function peg$parse(input, options) {
2131
2434
  peg$currPos += s2.length;
2132
2435
  } else {
2133
2436
  s2 = peg$FAILED;
2134
- if (peg$silentFails === 0) { peg$fail(peg$e30); }
2437
+ if (peg$silentFails === 0) { peg$fail(peg$e34); }
2135
2438
  }
2136
2439
  }
2137
2440
  }
@@ -2143,7 +2446,7 @@ function peg$parse(input, options) {
2143
2446
  peg$currPos += s4.length;
2144
2447
  } else {
2145
2448
  s4 = peg$FAILED;
2146
- if (peg$silentFails === 0) { peg$fail(peg$e31); }
2449
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
2147
2450
  }
2148
2451
  while (s4 !== peg$FAILED) {
2149
2452
  s3.push(s4);
@@ -2152,7 +2455,7 @@ function peg$parse(input, options) {
2152
2455
  peg$currPos += s4.length;
2153
2456
  } else {
2154
2457
  s4 = peg$FAILED;
2155
- if (peg$silentFails === 0) { peg$fail(peg$e31); }
2458
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
2156
2459
  }
2157
2460
  }
2158
2461
  s2 = [s2, s3];
@@ -2169,7 +2472,7 @@ function peg$parse(input, options) {
2169
2472
  peg$silentFails--;
2170
2473
  if (s0 === peg$FAILED) {
2171
2474
  s1 = peg$FAILED;
2172
- if (peg$silentFails === 0) { peg$fail(peg$e27); }
2475
+ if (peg$silentFails === 0) { peg$fail(peg$e31); }
2173
2476
  }
2174
2477
 
2175
2478
  return s0;
@@ -2185,7 +2488,7 @@ function peg$parse(input, options) {
2185
2488
  peg$currPos++;
2186
2489
  } else {
2187
2490
  s1 = peg$FAILED;
2188
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
2491
+ if (peg$silentFails === 0) { peg$fail(peg$e36); }
2189
2492
  }
2190
2493
  while (s1 !== peg$FAILED) {
2191
2494
  s0.push(s1);
@@ -2194,7 +2497,7 @@ function peg$parse(input, options) {
2194
2497
  peg$currPos++;
2195
2498
  } else {
2196
2499
  s1 = peg$FAILED;
2197
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
2500
+ if (peg$silentFails === 0) { peg$fail(peg$e36); }
2198
2501
  }
2199
2502
  }
2200
2503
  peg$silentFails--;
@@ -2217,6 +2520,11 @@ function union(types) {
2217
2520
  return { kind: "union", types };
2218
2521
  }
2219
2522
 
2523
+ function intersection(types) {
2524
+ if (types.length === 1) return types[0];
2525
+ return { kind: "intersection", types };
2526
+ }
2527
+
2220
2528
  function record(fields) {
2221
2529
  for(let i = 0; i < fields.length; i++) {
2222
2530
  fields[i].name ??= String(i);
@@ -2236,6 +2544,10 @@ function string(parts) {
2236
2544
  return { kind: 'template', parts };
2237
2545
  }
2238
2546
 
2547
+ function tupleElement(type, spread) {
2548
+ return { type, spread: spread ?? false };
2549
+ }
2550
+
2239
2551
  peg$result = peg$startRuleFunction();
2240
2552
 
2241
2553
  const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);