@dbml/parse 3.1.9-alpha.0 → 3.3.0

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.
@@ -1,6 +1,6 @@
1
1
  import I from "lodash";
2
2
  var u = /* @__PURE__ */ ((t) => (t.SPACE = "<space>", t.TAB = "<tab>", t.NEWLINE = "<newline>", t.COMMA = "<comma>", t.LPAREN = "<lparen>", t.RPAREN = "<rparen>", t.LBRACE = "<lbrace>", t.RBRACE = "<rbrace>", t.LBRACKET = "<lbracket>", t.RBRACKET = "<rbracket>", t.LANGLE = "<langle>", t.RANGLE = "<rangle>", t.OP = "<op>", t.EOF = "<eof>", t.NUMERIC_LITERAL = "<number>", t.STRING_LITERAL = "<string>", t.COLOR_LITERAL = "<color>", t.FUNCTION_EXPRESSION = "<function-expression>", t.QUOTED_STRING = "<variable>", t.IDENTIFIER = "<identifier>", t.SEMICOLON = "<semicolon>", t.COLON = "<colon>", t.SINGLE_LINE_COMMENT = "<single-line-comment>", t.MULTILINE_COMMENT = "<multiline-comment>", t))(u || {});
3
- function $t(t) {
3
+ function Wt(t) {
4
4
  switch (t.kind) {
5
5
  case "<newline>":
6
6
  case "<space>":
@@ -12,7 +12,7 @@ function $t(t) {
12
12
  return !1;
13
13
  }
14
14
  }
15
- function it(t) {
15
+ function rt(t) {
16
16
  if (!t)
17
17
  return !1;
18
18
  switch (t) {
@@ -33,7 +33,7 @@ function it(t) {
33
33
  return !1;
34
34
  }
35
35
  }
36
- function rt(t) {
36
+ function at(t) {
37
37
  return t !== void 0 && t.kind === "<op>";
38
38
  }
39
39
  class B {
@@ -44,27 +44,27 @@ class B {
44
44
  return new B(e, n, s, i, r);
45
45
  }
46
46
  }
47
- function Tt(t) {
47
+ function bt(t) {
48
48
  return t.trailingTrivia.find(({ kind: e }) => e === u.NEWLINE) !== void 0;
49
49
  }
50
- function at(t, e) {
51
- return e.leadingTrivia.find(({ kind: s }) => s === u.NEWLINE) !== void 0 || Tt(t);
50
+ function ot(t, e) {
51
+ return e.leadingTrivia.find(({ kind: s }) => s === u.NEWLINE) !== void 0 || bt(t);
52
52
  }
53
- function Ve(t) {
53
+ function Ce(t) {
54
54
  return t.trailingTrivia.find(({ kind: e }) => e === u.SPACE) !== void 0;
55
55
  }
56
- function bt(t) {
57
- return t.trailingTrivia.length === 0 ? t.end : bt(I.last(t.trailingTrivia));
58
- }
59
56
  function It(t) {
60
- return t.leadingTrivia.length === 0 ? t.start : It(t.leadingTrivia[0]);
57
+ return t.trailingTrivia.length === 0 ? t.end : It(I.last(t.trailingTrivia));
61
58
  }
62
- function Wt(t) {
59
+ function Lt(t) {
60
+ return t.leadingTrivia.length === 0 ? t.start : Lt(t.leadingTrivia[0]);
61
+ }
62
+ function jt(t) {
63
63
  return [u.SINGLE_LINE_COMMENT, u.MULTILINE_COMMENT].includes(
64
64
  t.kind
65
65
  );
66
66
  }
67
- class jt {
67
+ class Yt {
68
68
  constructor() {
69
69
  this.id = 0;
70
70
  }
@@ -81,13 +81,13 @@ class k {
81
81
  constructor(e, n, s) {
82
82
  this.id = e, this.kind = n;
83
83
  const i = s.find((a) => a !== void 0 && !Number.isNaN(a.start));
84
- i ? (this.startPos = i.startPos, this.fullStart = i instanceof B ? It(i) : i.fullStart) : (this.startPos = {
84
+ i ? (this.startPos = i.startPos, this.fullStart = i instanceof B ? Lt(i) : i.fullStart) : (this.startPos = {
85
85
  offset: NaN,
86
86
  column: NaN,
87
87
  line: NaN
88
88
  }, this.fullStart = NaN);
89
89
  const r = [...s].reverse().find((a) => a !== void 0 && !Number.isNaN(a.end));
90
- r ? (this.endPos = r.endPos, this.fullEnd = r instanceof B ? bt(r) : r.fullEnd) : (this.endPos = {
90
+ r ? (this.endPos = r.endPos, this.fullEnd = r instanceof B ? It(r) : r.fullEnd) : (this.endPos = {
91
91
  offset: NaN,
92
92
  column: NaN,
93
93
  line: NaN
@@ -151,7 +151,7 @@ class H extends k {
151
151
  super(i, "<infix-expression>", [n, e, s]), this.op = e, this.leftExpression = n, this.rightExpression = s;
152
152
  }
153
153
  }
154
- class De extends k {
154
+ class Pe extends k {
155
155
  constructor({ op: e, expression: n }, s) {
156
156
  super(s, "<postfix-expression>", [n, e]), this.op = e, this.expression = n;
157
157
  }
@@ -184,7 +184,7 @@ class P extends k {
184
184
  }, r) {
185
185
  super(r, "<list-expression>", [
186
186
  e,
187
- ...Lt(n, s),
187
+ ...gt(n, s),
188
188
  i
189
189
  ]), this.listOpenBracket = e, this.elementList = n, this.commaList = s, this.listCloseBracket = i;
190
190
  }
@@ -198,12 +198,12 @@ class Z extends k {
198
198
  }, r) {
199
199
  super(r, "<tuple-expression>", [
200
200
  e,
201
- ...Lt(n, s),
201
+ ...gt(n, s),
202
202
  i
203
203
  ]), this.tupleOpenParen = e, this.elementList = n, this.commaList = s, this.tupleCloseParen = i;
204
204
  }
205
205
  }
206
- class Xe extends Z {
206
+ class We extends Z {
207
207
  constructor({
208
208
  groupOpenParen: e,
209
209
  expression: n,
@@ -243,7 +243,7 @@ class D extends k {
243
243
  super(n, "<primary-expression>", [e]), this.expression = e;
244
244
  }
245
245
  }
246
- class ye extends k {
246
+ class ke extends k {
247
247
  constructor({ pre: e }, n) {
248
248
  const s = B.create(u.SPACE, e.endPos, e.endPos, " ", !1);
249
249
  super(n, "<dummy>", [s]);
@@ -254,7 +254,7 @@ class ce extends k {
254
254
  super(s, "<array>", [e, n]), this.array = e, this.indexer = n;
255
255
  }
256
256
  }
257
- function Lt(t, e) {
257
+ function gt(t, e) {
258
258
  if (!t || t.length === 0)
259
259
  return e || [];
260
260
  if (!e || e.length === 0)
@@ -264,7 +264,7 @@ function Lt(t, e) {
264
264
  (i) => i !== null
265
265
  );
266
266
  }
267
- function as(t, e = !1) {
267
+ function os(t, e = !1) {
268
268
  return JSON.stringify(
269
269
  t,
270
270
  function(n, s) {
@@ -335,46 +335,46 @@ class v {
335
335
  }
336
336
  }
337
337
  var m = /* @__PURE__ */ ((t) => (t.Schema = "Schema", t.Table = "Table", t.Column = "Column", t.TableGroup = "TableGroup", t.TableGroupField = "TableGroup field", t.Enum = "Enum", t.EnumField = "Enum field", t.Note = "Note", t))(m || {});
338
- function $e(t) {
338
+ function je(t) {
339
339
  return `Schema:${t}`;
340
340
  }
341
- function xe(t) {
341
+ function Se(t) {
342
342
  return `Table:${t}`;
343
343
  }
344
- function We(t) {
344
+ function Ye(t) {
345
345
  return `Column:${t}`;
346
346
  }
347
- function je(t) {
347
+ function ze(t) {
348
348
  return `Enum:${t}`;
349
349
  }
350
- function Ye(t) {
350
+ function Qe(t) {
351
351
  return `Enum field:${t}`;
352
352
  }
353
- function ze(t) {
353
+ function qe(t) {
354
354
  return `TableGroup:${t}`;
355
355
  }
356
- function Qe(t) {
356
+ function He(t) {
357
357
  return `TableGroup field:${t}`;
358
358
  }
359
- function Yt(t) {
359
+ function zt(t) {
360
360
  return `Note:${t}`;
361
361
  }
362
- function Fe(t, e) {
362
+ function Ve(t, e) {
363
363
  switch (e) {
364
364
  case "Column":
365
- return We(t);
365
+ return Ye(t);
366
366
  case "Enum":
367
- return je(t);
367
+ return ze(t);
368
368
  case "Enum field":
369
- return Ye(t);
369
+ return Qe(t);
370
370
  case "Schema":
371
- return $e(t);
371
+ return je(t);
372
372
  case "Table":
373
- return xe(t);
373
+ return Se(t);
374
374
  case "TableGroup":
375
- return ze(t);
375
+ return qe(t);
376
376
  case "TableGroup field":
377
- return Qe(t);
377
+ return He(t);
378
378
  default:
379
379
  throw new Error("Unreachable");
380
380
  }
@@ -386,40 +386,39 @@ function ie(t) {
386
386
  kind: e
387
387
  }) : new v();
388
388
  }
389
- function zt(t) {
389
+ function Qt(t) {
390
390
  const e = ie(t).unwrap_or(void 0);
391
391
  if (!e)
392
392
  return !1;
393
393
  const { kind: n, name: s } = e;
394
394
  return n === "Schema" && s === "public";
395
395
  }
396
- function Qt(t) {
396
+ function qt(t) {
397
397
  return [
398
- $e,
399
- xe,
400
398
  je,
399
+ Se,
401
400
  ze,
402
- We,
401
+ qe,
403
402
  Ye,
404
- Qe
403
+ Qe,
404
+ He
405
405
  ].map((e) => e(t));
406
406
  }
407
- function qe(t) {
408
- const [e] = t;
409
- return e >= "a" && e <= "z" || e >= "A" && e <= "Z" || e === "_";
407
+ function Ue(t) {
408
+ return !!t.match(/(\p{L}|_|\p{M})/gu);
410
409
  }
411
- function Se(t) {
410
+ function Oe(t) {
412
411
  const [e] = t;
413
412
  return e >= "0" && e <= "9";
414
413
  }
415
- function qt(t) {
414
+ function Ht(t) {
416
415
  const [e] = t;
417
- return Se(e) || qe(e) && e.toLowerCase() >= "a" && e.toLowerCase() <= "f";
416
+ return Oe(e) || Ue(e) && e.toLowerCase() >= "a" && e.toLowerCase() <= "f";
418
417
  }
419
418
  function pe(t) {
420
- return qe(t) || Se(t);
419
+ return Ue(t) || Oe(t);
421
420
  }
422
- function ot(t, e) {
421
+ function lt(t, e) {
423
422
  const n = [], s = Math.min(t.length, e.length);
424
423
  for (let i = 0; i < s; i += 1)
425
424
  n.push(t[i], e[i]);
@@ -428,7 +427,7 @@ function ot(t, e) {
428
427
  function Le(t, e) {
429
428
  return t >= e.start && t < e.end;
430
429
  }
431
- class Ht {
430
+ class Jt {
432
431
  constructor() {
433
432
  this.id = 0;
434
433
  }
@@ -439,37 +438,37 @@ class Ht {
439
438
  return this.id++;
440
439
  }
441
440
  }
442
- class gt {
441
+ class _t {
443
442
  constructor({ symbolTable: e }, n) {
444
443
  this.references = [], this.id = n, this.symbolTable = e;
445
444
  }
446
445
  }
447
- class Jt {
446
+ class Zt {
448
447
  constructor({ symbolTable: e, declaration: n }, s) {
449
448
  this.references = [], this.id = s, this.symbolTable = e, this.declaration = n;
450
449
  }
451
450
  }
452
- class Zt {
451
+ class Kt {
453
452
  constructor({ declaration: e }, n) {
454
453
  this.references = [], this.id = n, this.declaration = e;
455
454
  }
456
455
  }
457
- class _t {
456
+ class At {
458
457
  constructor({ symbolTable: e, declaration: n }, s) {
459
458
  this.references = [], this.id = s, this.symbolTable = e, this.declaration = n;
460
459
  }
461
460
  }
462
- class Kt {
461
+ class en {
463
462
  constructor({ declaration: e }, n) {
464
463
  this.references = [], this.id = n, this.declaration = e;
465
464
  }
466
465
  }
467
- class en {
466
+ class tn {
468
467
  constructor({ symbolTable: e, declaration: n }, s) {
469
468
  this.references = [], this.id = s, this.symbolTable = e, this.declaration = n;
470
469
  }
471
470
  }
472
- class tn {
471
+ class nn {
473
472
  constructor({ declaration: e }, n) {
474
473
  this.references = [], this.id = n, this.declaration = e;
475
474
  }
@@ -498,18 +497,18 @@ class F {
498
497
  return new F(e(this.value), this.errors);
499
498
  }
500
499
  }
501
- function nn(t, e, n) {
500
+ function sn(t, e, n) {
502
501
  if (!t || !Ee(t) || e.length === 0)
503
502
  return new v();
504
- const s = [...e], i = Be(t).unwrap(), r = s.pop();
503
+ const s = [...e], i = Ge(t).unwrap(), r = s.pop();
505
504
  if (!(r instanceof ne))
506
505
  return new v();
507
506
  const a = I.last(s) instanceof P ? s.pop() : void 0;
508
- return s.length === 3 && Be(s[1]).unwrap().value === "as" ? new S(
507
+ return s.length === 3 && Ge(s[1]).unwrap().value === "as" ? new S(
509
508
  n.create(A, {
510
509
  type: i,
511
510
  name: s[0],
512
- as: Be(s[1]).unwrap(),
511
+ as: Ge(s[1]).unwrap(),
513
512
  alias: s[2],
514
513
  attributeList: a,
515
514
  body: r
@@ -529,16 +528,16 @@ function nn(t, e, n) {
529
528
  })
530
529
  ) : new v();
531
530
  }
532
- function lt(t) {
531
+ function ct(t) {
533
532
  return t.kind === u.IDENTIFIER && t.value === "as";
534
533
  }
535
534
  function E(t) {
536
- t && (t instanceof B ? sn(t) : rn(t));
535
+ t && (t instanceof B ? rn(t) : an(t));
537
536
  }
538
- function sn(t) {
537
+ function rn(t) {
539
538
  t.kind !== u.EOF && (t.isInvalid = !0);
540
539
  }
541
- function rn(t) {
540
+ function an(t) {
542
541
  if (t instanceof A)
543
542
  E(t.type), E(t.name), E(t.as), E(t.alias), E(t.bodyColon), E(t.attributeList), E(t.body);
544
543
  else if (t instanceof $)
@@ -549,7 +548,7 @@ function rn(t) {
549
548
  E(t.op), E(t.expression);
550
549
  else if (t instanceof H)
551
550
  E(t.leftExpression), E(t.op), E(t.rightExpression);
552
- else if (t instanceof De)
551
+ else if (t instanceof Pe)
553
552
  E(t.op), E(t.expression);
554
553
  else if (t instanceof ne)
555
554
  E(t.blockOpenBrace), t.body.forEach(E), E(t.blockCloseBrace);
@@ -570,15 +569,15 @@ function rn(t) {
570
569
  else if (t instanceof me)
571
570
  E(t.literal);
572
571
  else
573
- throw t instanceof Xe ? new Error("This case is handled by the TupleExpressionNode case") : new Error("Unreachable case in markInvalidNode");
572
+ throw t instanceof We ? new Error("This case is handled by the TupleExpressionNode case") : new Error("Unreachable case in markInvalidNode");
574
573
  }
575
- function At(t) {
574
+ function vt(t) {
576
575
  return !!(t != null && t.isInvalid);
577
576
  }
578
577
  function U(...t) {
579
578
  return t.filter((e) => e !== void 0);
580
579
  }
581
- function an(t) {
580
+ function on(t) {
582
581
  if (t instanceof G)
583
582
  return U(...t.body, t.eof);
584
583
  if (t instanceof A)
@@ -603,7 +602,7 @@ function an(t) {
603
602
  return U(t.op, t.expression);
604
603
  if (t instanceof H)
605
604
  return U(t.leftExpression, t.op, t.rightExpression);
606
- if (t instanceof De)
605
+ if (t instanceof Pe)
607
606
  return U(t.expression, t.op);
608
607
  if (t instanceof te)
609
608
  return U(t.value);
@@ -614,13 +613,13 @@ function an(t) {
614
613
  if (t instanceof P)
615
614
  return U(
616
615
  t.listOpenBracket,
617
- ...ot(t.elementList, t.commaList),
616
+ ...lt(t.elementList, t.commaList),
618
617
  t.listCloseBracket
619
618
  );
620
619
  if (t instanceof Z)
621
620
  return U(
622
621
  t.tupleOpenParen,
623
- ...ot(t.elementList, t.commaList),
622
+ ...lt(t.elementList, t.commaList),
624
623
  t.tupleCloseParen
625
624
  );
626
625
  if (t instanceof J)
@@ -632,9 +631,9 @@ function an(t) {
632
631
  t.array,
633
632
  t.indexer
634
633
  );
635
- throw t instanceof Xe ? new Error("This case is already handled by TupleExpressionNode") : new Error("Unreachable - no other possible cases");
634
+ throw t instanceof We ? new Error("This case is already handled by TupleExpressionNode") : new Error("Unreachable - no other possible cases");
636
635
  }
637
- function Be(t) {
636
+ function Ge(t) {
638
637
  return M(t) ? new S(t.expression.variable) : new v();
639
638
  }
640
639
  function Y(t) {
@@ -648,7 +647,7 @@ function Ee(t) {
648
647
  var e;
649
648
  return t instanceof D && t.expression instanceof j && ((e = t.expression.variable) == null ? void 0 : e.kind) === u.IDENTIFIER;
650
649
  }
651
- function He(t) {
650
+ function Je(t) {
652
651
  var e;
653
652
  return t instanceof H && t.leftExpression instanceof k && t.rightExpression instanceof k && ((e = t.op) == null ? void 0 : e.value) === ".";
654
653
  }
@@ -658,7 +657,7 @@ function Ne(t) {
658
657
  const e = t.identifiers.map((n) => n.value).join(" ");
659
658
  return e === "" ? new v() : new S(e);
660
659
  }
661
- class on {
660
+ class ln {
662
661
  // list of errors during lexing
663
662
  constructor(e) {
664
663
  this.start = {
@@ -768,15 +767,15 @@ class on {
768
767
  this.match("/") ? this.singleLineComment() : this.match("*") ? this.multilineComment() : this.operator();
769
768
  break;
770
769
  default:
771
- if (it(e)) {
770
+ if (rt(e)) {
772
771
  this.operator();
773
772
  break;
774
773
  }
775
- if (qe(e)) {
774
+ if (Ue(e)) {
776
775
  this.identifier();
777
776
  break;
778
777
  }
779
- if (Se(e)) {
778
+ if (Oe(e)) {
780
779
  this.numericLiteralOrIdentifier();
781
780
  break;
782
781
  }
@@ -796,13 +795,13 @@ class on {
796
795
  let e = !0, n = [], s;
797
796
  const i = [];
798
797
  for (const r of this.tokens)
799
- $t(r) ? (n.push(r), r.kind === u.NEWLINE && s && (s.trailingTrivia = n, e = !0, s = void 0, n = [])) : (e ? r.leadingTrivia = n : s.trailingTrivia = n, i.push(r), n = [], s = r, e = !1);
798
+ Wt(r) ? (n.push(r), r.kind === u.NEWLINE && s && (s.trailingTrivia = n, e = !0, s = void 0, n = [])) : (e ? r.leadingTrivia = n : s.trailingTrivia = n, i.push(r), n = [], s = r, e = !1);
800
799
  this.tokens = i;
801
800
  }
802
801
  gatherInvalid() {
803
802
  let e;
804
803
  const n = [], s = [];
805
- for (e = 0; e < this.tokens.length && At(this.tokens[e]); e += 1)
804
+ for (e = 0; e < this.tokens.length && vt(this.tokens[e]); e += 1)
806
805
  s.push(this.tokens[e]);
807
806
  let i = this.tokens[e];
808
807
  for (i.leadingInvalid = [...s, ...i.leadingInvalid]; e < this.tokens.length; e += 1) {
@@ -896,7 +895,7 @@ class on {
896
895
  this.addToken(u.IDENTIFIER);
897
896
  }
898
897
  operator() {
899
- for (; it(this.peek()); )
898
+ for (; rt(this.peek()); )
900
899
  this.advance();
901
900
  this.addToken(u.OP);
902
901
  }
@@ -913,7 +912,7 @@ class on {
913
912
  return this.advance(), this.addToken(u.NUMERIC_LITERAL);
914
913
  if (!n && !pe(this.peek()))
915
914
  return this.addToken(u.NUMERIC_LITERAL);
916
- if (!n && !Se(this.peek()))
915
+ if (!n && !Oe(this.peek()))
917
916
  break;
918
917
  this.advance();
919
918
  }
@@ -973,8 +972,8 @@ class on {
973
972
  }
974
973
  }
975
974
  }
976
- var ke = /* @__PURE__ */ ((t) => (t[t.ListExpression = 0] = "ListExpression", t[t.GroupExpression = 1] = "GroupExpression", t[t.BlockExpression = 2] = "BlockExpression", t))(ke || {});
977
- class ln {
975
+ var xe = /* @__PURE__ */ ((t) => (t[t.ListExpression = 0] = "ListExpression", t[t.GroupExpression = 1] = "GroupExpression", t[t.BlockExpression = 2] = "BlockExpression", t))(xe || {});
976
+ class cn {
978
977
  constructor() {
979
978
  this.stack = [], this.numberOfNestedLParens = 0, this.numberOfNestedLBrackets = 0, this.numberOfNestedLBraces = 0;
980
979
  }
@@ -1040,7 +1039,7 @@ class ln {
1040
1039
  }
1041
1040
  }
1042
1041
  }
1043
- class cn {
1042
+ class un {
1044
1043
  constructor(e) {
1045
1044
  this.generator = e;
1046
1045
  }
@@ -1053,15 +1052,15 @@ class d {
1053
1052
  this.token = e, this.partialNode = n, this.handlerContext = s;
1054
1053
  }
1055
1054
  }
1056
- class un {
1055
+ class hn {
1057
1056
  constructor(e, n) {
1058
- this.current = 0, this.errors = [], this.contextStack = new ln(), this.synchronizeProgram = () => {
1057
+ this.current = 0, this.errors = [], this.contextStack = new cn(), this.synchronizeProgram = () => {
1059
1058
  const s = this.peek();
1060
1059
  s.kind !== u.EOF ? E(this.advance()) : (E(this.peek()), this.logError(s, o.UNEXPECTED_EOF, "Unexpected EOF"));
1061
1060
  }, this.synchronizeElementDeclarationName = () => {
1062
1061
  for (; !this.isAtEnd(); ) {
1063
1062
  const s = this.peek();
1064
- if (lt(s) || this.check(u.COLON, u.LBRACE, u.LBRACKET))
1063
+ if (ct(s) || this.check(u.COLON, u.LBRACE, u.LBRACKET))
1065
1064
  break;
1066
1065
  E(s), this.advance();
1067
1066
  }
@@ -1072,7 +1071,7 @@ class un {
1072
1071
  break;
1073
1072
  E(s), this.advance();
1074
1073
  }
1075
- }, this.blockExpression = this.contextStack.withContextDo(ke.BlockExpression, () => {
1074
+ }, this.blockExpression = this.contextStack.withContextDo(xe.BlockExpression, () => {
1076
1075
  const s = { body: [] }, i = () => this.nodeFactory.create(ne, s);
1077
1076
  try {
1078
1077
  this.consume("Expect an opening brace '{'", u.LBRACE), s.blockOpenBrace = this.previous();
@@ -1107,12 +1106,12 @@ class un {
1107
1106
  if (!this.check(u.RBRACE))
1108
1107
  for (E(this.advance()); !this.isAtEnd(); ) {
1109
1108
  const s = this.peek();
1110
- if (this.check(u.RBRACE) || at(this.previous(), s))
1109
+ if (this.check(u.RBRACE) || ot(this.previous(), s))
1111
1110
  break;
1112
1111
  E(s), this.advance();
1113
1112
  }
1114
- }, this.tupleExpression = this.contextStack.withContextDo(ke.GroupExpression, () => {
1115
- const s = { elementList: [], commaList: [] }, i = () => this.nodeFactory.create(Xe, {
1113
+ }, this.tupleExpression = this.contextStack.withContextDo(xe.GroupExpression, () => {
1114
+ const s = { elementList: [], commaList: [] }, i = () => this.nodeFactory.create(We, {
1116
1115
  groupOpenParen: s.tupleOpenParen,
1117
1116
  groupCloseParen: s.tupleCloseParen,
1118
1117
  expression: s.elementList[0]
@@ -1163,7 +1162,7 @@ class un {
1163
1162
  break;
1164
1163
  E(s), this.advance();
1165
1164
  }
1166
- }, this.listExpression = this.contextStack.withContextDo(ke.ListExpression, () => {
1165
+ }, this.listExpression = this.contextStack.withContextDo(xe.ListExpression, () => {
1167
1166
  const s = { elementList: [], commaList: [] }, i = () => this.nodeFactory.create(P, s);
1168
1167
  try {
1169
1168
  this.consume("Expect an opening bracket '['", u.LBRACKET), s.listOpenBracket = this.previous();
@@ -1225,7 +1224,7 @@ class un {
1225
1224
  break;
1226
1225
  E(s), this.advance();
1227
1226
  }
1228
- }, this.tokens = e, this.nodeFactory = new cn(n);
1227
+ }, this.tokens = e, this.nodeFactory = new un(n);
1229
1228
  }
1230
1229
  isAtEnd() {
1231
1230
  return this.current >= this.tokens.length || this.tokens[this.current].kind === u.EOF;
@@ -1316,7 +1315,7 @@ class un {
1316
1315
  throw new d(s.token, n(), s.handlerContext);
1317
1316
  this.synchronizeElementDeclarationName();
1318
1317
  }
1319
- if (lt(this.peek()))
1318
+ if (ct(this.peek()))
1320
1319
  if (e.as = this.advance(), this.check(u.COLON, u.LBRACE, u.LBRACKET))
1321
1320
  this.logError(this.peek(), o.UNEXPECTED_TOKEN, "Expect an alias");
1322
1321
  else
@@ -1380,7 +1379,7 @@ class un {
1380
1379
  }
1381
1380
  /* Parsing any ExpressionNode, including non-NormalExpression */
1382
1381
  expression() {
1383
- const e = { args: [] }, n = () => nn(e.callee, e.args, this.nodeFactory).unwrap_or(
1382
+ const e = { args: [] }, n = () => sn(e.callee, e.args, this.nodeFactory).unwrap_or(
1384
1383
  this.nodeFactory.create(w, e)
1385
1384
  );
1386
1385
  try {
@@ -1392,7 +1391,7 @@ class un {
1392
1391
  return n();
1393
1392
  let s = e.callee;
1394
1393
  for (; !this.shouldStopExpression(); ) {
1395
- Ve(this.previous()) || this.logError(s, o.MISSING_SPACES, "Expect a following space");
1394
+ Ce(this.previous()) || this.logError(s, o.MISSING_SPACES, "Expect a following space");
1396
1395
  try {
1397
1396
  s = this.normalExpression(), e.args.push(s);
1398
1397
  } catch (i) {
@@ -1402,7 +1401,7 @@ class un {
1402
1401
  return n();
1403
1402
  }
1404
1403
  shouldStopExpression() {
1405
- if (this.isAtEnd() || Tt(this.previous()))
1404
+ if (this.isAtEnd() || bt(this.previous()))
1406
1405
  return !0;
1407
1406
  const e = this.peek().kind;
1408
1407
  return e === u.RBRACE || e === u.RBRACKET || e === u.RPAREN || e === u.COMMA || e === u.COLON;
@@ -1416,12 +1415,12 @@ class un {
1416
1415
  for (; !this.isAtEnd(); ) {
1417
1416
  const s = this.peek();
1418
1417
  if (s.kind === u.LPAREN) {
1419
- const { left: i } = ct(s);
1418
+ const { left: i } = ut(s);
1420
1419
  if (i < e || // When '(' is encountered,
1421
1420
  // consider it part of another expression if
1422
1421
  // it's at the start of a new line
1423
1422
  // and we're currently not having unmatched '(' or '['
1424
- at(this.previous(), s) && !this.contextStack.isWithinGroupExpressionContext() && !this.contextStack.isWithinListExpressionContext())
1423
+ ot(this.previous(), s) && !this.contextStack.isWithinGroupExpressionContext() && !this.contextStack.isWithinListExpressionContext())
1425
1424
  break;
1426
1425
  try {
1427
1426
  n = this.nodeFactory.create(J, {
@@ -1435,7 +1434,7 @@ class un {
1435
1434
  }), new d(r.token, n, r.handlerContext)) : r;
1436
1435
  }
1437
1436
  } else if (s.kind === u.LBRACKET) {
1438
- if (Ve(this.previous()))
1437
+ if (Ce(this.previous()))
1439
1438
  break;
1440
1439
  try {
1441
1440
  n = this.nodeFactory.create(ce, {
@@ -1448,17 +1447,17 @@ class un {
1448
1447
  indexer: i.partialNode
1449
1448
  }), new d(i.token, n, i.handlerContext)) : i;
1450
1449
  }
1451
- } else if (rt(s)) {
1452
- const i = s, r = ct(i);
1450
+ } else if (at(s)) {
1451
+ const i = s, r = ut(i);
1453
1452
  if (r.left !== null) {
1454
1453
  if (r.left <= e)
1455
1454
  break;
1456
- this.advance(), n = this.nodeFactory.create(De, {
1455
+ this.advance(), n = this.nodeFactory.create(Pe, {
1457
1456
  expression: n,
1458
1457
  op: i
1459
1458
  });
1460
1459
  } else {
1461
- const a = fn(i);
1460
+ const a = pn(i);
1462
1461
  if (a.left === null || a.left <= e)
1463
1462
  break;
1464
1463
  this.advance();
@@ -1483,10 +1482,10 @@ class un {
1483
1482
  }
1484
1483
  leftExpression_bp() {
1485
1484
  let e;
1486
- if (rt(this.peek())) {
1485
+ if (at(this.peek())) {
1487
1486
  const n = {};
1488
1487
  n.op = this.peek();
1489
- const s = dn(n.op);
1488
+ const s = En(n.op);
1490
1489
  if (s.right === null)
1491
1490
  throw this.logError(
1492
1491
  n.op,
@@ -1494,7 +1493,7 @@ class un {
1494
1493
  `Unexpected '${n.op.value}' in an expression`
1495
1494
  ), new d(
1496
1495
  n.op,
1497
- this.nodeFactory.create(ye, { pre: n.op }),
1496
+ this.nodeFactory.create(ke, { pre: n.op }),
1498
1497
  this.contextStack.findHandlerContext(this.tokens, this.current)
1499
1498
  );
1500
1499
  this.advance();
@@ -1508,10 +1507,10 @@ class un {
1508
1507
  )) : i;
1509
1508
  }
1510
1509
  e = this.nodeFactory.create(q, n);
1511
- } else if (e = this.extractOperand(), e instanceof ye)
1510
+ } else if (e = this.extractOperand(), e instanceof ke)
1512
1511
  throw new d(
1513
1512
  this.peek(),
1514
- this.nodeFactory.create(ye, { pre: this.peek() }),
1513
+ this.nodeFactory.create(ke, { pre: this.peek() }),
1515
1514
  this.contextStack.findHandlerContext(this.tokens, this.current)
1516
1515
  );
1517
1516
  return e;
@@ -1535,7 +1534,7 @@ class un {
1535
1534
  this.peek(),
1536
1535
  o.INVALID_OPERAND,
1537
1536
  `Invalid start of operand "${this.peek().value}"`
1538
- ), this.nodeFactory.create(ye, { pre: this.previous() }));
1537
+ ), this.nodeFactory.create(ke, { pre: this.previous() }));
1539
1538
  }
1540
1539
  /* Parsing FunctionExpression */
1541
1540
  functionExpression() {
@@ -1632,7 +1631,7 @@ class un {
1632
1631
  this.errors.push(new c(n, s, e));
1633
1632
  }
1634
1633
  }
1635
- const hn = {
1634
+ const fn = {
1636
1635
  "+": { left: 9, right: 10 },
1637
1636
  "*": { left: 11, right: 12 },
1638
1637
  "-": { left: 9, right: 10 },
@@ -1648,10 +1647,10 @@ const hn = {
1648
1647
  "!=": { left: 4, right: 5 },
1649
1648
  ".": { left: 16, right: 17 }
1650
1649
  };
1651
- function fn(t) {
1652
- return hn[t.value] || { left: null, right: null };
1650
+ function pn(t) {
1651
+ return fn[t.value] || { left: null, right: null };
1653
1652
  }
1654
- const pn = {
1653
+ const dn = {
1655
1654
  "+": { left: null, right: 15 },
1656
1655
  "-": { left: null, right: 15 },
1657
1656
  "<": { left: null, right: 15 },
@@ -1659,17 +1658,17 @@ const pn = {
1659
1658
  "<>": { left: null, right: 15 },
1660
1659
  "!": { left: null, right: 15 }
1661
1660
  };
1662
- function dn(t) {
1663
- return pn[t.value] || { left: null, right: null };
1661
+ function En(t) {
1662
+ return dn[t.value] || { left: null, right: null };
1664
1663
  }
1665
- const En = {
1664
+ const Nn = {
1666
1665
  "(": { left: 14, right: null }
1667
1666
  };
1668
- function ct(t) {
1669
- return En[t.value] || { left: null, right: null };
1667
+ function ut(t) {
1668
+ return Nn[t.value] || { left: null, right: null };
1670
1669
  }
1671
1670
  var b = /* @__PURE__ */ ((t) => (t.Table = "table", t.Enum = "enum", t.Ref = "ref", t.Note = "note", t.Project = "project", t.Indexes = "indexes", t.TableGroup = "tablegroup", t))(b || {});
1672
- function Ae(t) {
1671
+ function ve(t) {
1673
1672
  var n;
1674
1673
  const e = (n = t == null ? void 0 : t.type) == null ? void 0 : n.value.toLowerCase();
1675
1674
  switch (e) {
@@ -1686,7 +1685,7 @@ function Ae(t) {
1686
1685
  }
1687
1686
  }
1688
1687
  function he(t) {
1689
- if (!He(t))
1688
+ if (!Je(t))
1690
1689
  return new S([t]);
1691
1690
  const e = he(t.leftExpression).unwrap_or(void 0);
1692
1691
  return e ? (e.push(t.rightExpression), new S(e)) : new v();
@@ -1706,7 +1705,7 @@ function C(t) {
1706
1705
  }
1707
1706
  return new S(n);
1708
1707
  }
1709
- function ge(t) {
1708
+ function _e(t) {
1710
1709
  if (t === void 0)
1711
1710
  return new v();
1712
1711
  const e = he(t).unwrap_or(void 0);
@@ -1716,7 +1715,7 @@ function ge(t) {
1716
1715
  let s;
1717
1716
  if (!M(I.last(e))) {
1718
1717
  const i = e.pop();
1719
- if (yt(i))
1718
+ if (kt(i))
1720
1719
  s = i.elementList.map(
1721
1720
  (r) => V(r).unwrap()
1722
1721
  );
@@ -1737,10 +1736,10 @@ function ge(t) {
1737
1736
  function X(t) {
1738
1737
  return M(t) ? new S(t.expression.variable.value) : new v();
1739
1738
  }
1740
- function Ge(t) {
1741
- if (ut(t))
1739
+ function Xe(t) {
1740
+ if (ht(t))
1742
1741
  return t instanceof te ? new S({ functional: [t], nonFunctional: [] }) : new S({ functional: [], nonFunctional: [t] });
1743
- if (t instanceof Z && t.elementList.every(ut)) {
1742
+ if (t instanceof Z && t.elementList.every(ht)) {
1744
1743
  const e = t.elementList.filter(
1745
1744
  (s) => s instanceof te
1746
1745
  ), n = t.elementList.filter(M);
@@ -1756,24 +1755,24 @@ function V(t) {
1756
1755
  function Q(t) {
1757
1756
  return Y(t) ? t.expression instanceof j ? new S(t.expression.variable.value) : new S(t.expression.literal.value) : new v();
1758
1757
  }
1759
- function Nn(t) {
1758
+ function mn(t) {
1760
1759
  var e;
1761
- return !(t instanceof H) || !wt((e = t.op) == null ? void 0 : e.value) ? !1 : ge(t.leftExpression).and_then(() => ge(t.rightExpression)).unwrap_or(void 0) !== void 0;
1760
+ return !(t instanceof H) || !yt((e = t.op) == null ? void 0 : e.value) ? !1 : _e(t.leftExpression).and_then(() => _e(t.rightExpression)).unwrap_or(void 0) !== void 0;
1762
1761
  }
1763
- function mn(t) {
1764
- const e = ge(t.leftExpression), n = ge(t.rightExpression);
1762
+ function Tn(t) {
1763
+ const e = _e(t.leftExpression), n = _e(t.rightExpression);
1765
1764
  if (!e.isOk() || !n.isOk())
1766
1765
  return !1;
1767
1766
  const { tupleElements: s } = e.unwrap(), { tupleElements: i } = n.unwrap();
1768
1767
  return (s == null ? void 0 : s.length) === (i == null ? void 0 : i.length);
1769
1768
  }
1770
- function ut(t) {
1769
+ function ht(t) {
1771
1770
  return t instanceof D && t.expression instanceof j || t instanceof te;
1772
1771
  }
1773
- function Tn(t, e) {
1772
+ function bn(t, e) {
1774
1773
  var i, r, a, l;
1775
1774
  let n = e;
1776
- const s = zt(t);
1775
+ const s = Qt(t);
1777
1776
  for (; n; ) {
1778
1777
  if ((r = (i = n.symbol) == null ? void 0 : i.symbolTable) != null && r.has(t))
1779
1778
  return (a = n.symbol.symbolTable) == null ? void 0 : a.get(t);
@@ -1784,7 +1783,7 @@ function Tn(t, e) {
1784
1783
  n = n.parent;
1785
1784
  }
1786
1785
  }
1787
- class bn {
1786
+ class In {
1788
1787
  constructor(e, n, s) {
1789
1788
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
1790
1789
  }
@@ -1792,7 +1791,7 @@ class bn {
1792
1791
  return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.validateBody(this.declarationNode.body)];
1793
1792
  }
1794
1793
  validateContext() {
1795
- return this.declarationNode.parent instanceof G || Ae(this.declarationNode.parent).unwrap_or(void 0) !== b.Project ? [new c(o.INVALID_CUSTOM_CONTEXT, "A custom element can only appear in a Project", this.declarationNode)] : [];
1794
+ return this.declarationNode.parent instanceof G || ve(this.declarationNode.parent).unwrap_or(void 0) !== b.Project ? [new c(o.INVALID_CUSTOM_CONTEXT, "A custom element can only appear in a Project", this.declarationNode)] : [];
1796
1795
  }
1797
1796
  validateName(e) {
1798
1797
  return e ? [new c(o.UNEXPECTED_NAME, "A Custom element shouldn't have a name", e)] : [];
@@ -1812,7 +1811,7 @@ class bn {
1812
1811
  return Y(e.callee) || n.push(new c(o.INVALID_CUSTOM_ELEMENT_VALUE, "A Custom element value can only be a string", e)), e.args.length > 0 && n.push(...e.args.map((s) => new c(o.INVALID_CUSTOM_ELEMENT_VALUE, "A Custom element value can only be a string", s))), n;
1813
1812
  }
1814
1813
  }
1815
- class ve {
1814
+ class we {
1816
1815
  constructor() {
1817
1816
  this.table = /* @__PURE__ */ new Map();
1818
1817
  }
@@ -1829,7 +1828,7 @@ class ve {
1829
1828
  return this.table.entries();
1830
1829
  }
1831
1830
  }
1832
- class In {
1831
+ class Ln {
1833
1832
  constructor(e, n, s) {
1834
1833
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
1835
1834
  }
@@ -1840,17 +1839,17 @@ class In {
1840
1839
  return this.declarationNode.parent instanceof A ? [new c(o.INVALID_PROJECT_CONTEXT, "An Enum can only appear top-level", this.declarationNode)] : [];
1841
1840
  }
1842
1841
  validateName(e) {
1843
- return e ? Je(e) ? [] : [new c(o.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", e)] : [new c(o.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
1842
+ return e ? Ze(e) ? [] : [new c(o.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", e)] : [new c(o.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
1844
1843
  }
1845
1844
  validateAlias(e) {
1846
1845
  return e ? [new c(o.UNEXPECTED_ALIAS, "A Ref shouldn't have an alias", e)] : [];
1847
1846
  }
1848
1847
  registerElement() {
1849
1848
  const e = [];
1850
- this.declarationNode.symbol = this.symbolFactory.create(Jt, { declaration: this.declarationNode, symbolTable: new ve() });
1849
+ this.declarationNode.symbol = this.symbolFactory.create(Zt, { declaration: this.declarationNode, symbolTable: new we() });
1851
1850
  const { name: n } = this.declarationNode, s = C(n);
1852
1851
  if (s.isOk()) {
1853
- const i = s.unwrap(), r = i.pop(), a = Ze(i, this.publicSymbolTable, this.symbolFactory), l = je(r);
1852
+ const i = s.unwrap(), r = i.pop(), a = Ke(i, this.publicSymbolTable, this.symbolFactory), l = ze(r);
1854
1853
  a.has(l) && e.push(new c(o.DUPLICATE_NAME, `Enum name ${r} already exists in schema '${i.join(".") || "public"}'`, n)), a.set(l, this.declarationNode.symbol);
1855
1854
  }
1856
1855
  return e;
@@ -1900,7 +1899,7 @@ class In {
1900
1899
  }
1901
1900
  registerField(e) {
1902
1901
  if (e.callee && M(e.callee)) {
1903
- const n = V(e.callee).unwrap(), s = Ye(n), i = this.symbolFactory.create(Zt, { declaration: e });
1902
+ const n = V(e.callee).unwrap(), s = Qe(n), i = this.symbolFactory.create(Kt, { declaration: e });
1904
1903
  e.symbol = i;
1905
1904
  const r = this.declarationNode.symbol.symbolTable;
1906
1905
  if (r.has(s)) {
@@ -1915,7 +1914,7 @@ class In {
1915
1914
  return [];
1916
1915
  }
1917
1916
  }
1918
- class Ln {
1917
+ class gn {
1919
1918
  constructor(e, n, s) {
1920
1919
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
1921
1920
  }
@@ -1923,7 +1922,7 @@ class Ln {
1923
1922
  return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.validateBody(this.declarationNode.body)];
1924
1923
  }
1925
1924
  validateContext() {
1926
- return this.declarationNode.parent instanceof G || Ae(this.declarationNode.parent).unwrap_or(void 0) !== b.Table ? [new c(o.INVALID_NOTE_CONTEXT, "An Indexes can only appear inside a Table", this.declarationNode)] : [];
1925
+ return this.declarationNode.parent instanceof G || ve(this.declarationNode.parent).unwrap_or(void 0) !== b.Table ? [new c(o.INVALID_NOTE_CONTEXT, "An Indexes can only appear inside a Table", this.declarationNode)] : [];
1927
1926
  }
1928
1927
  validateName(e) {
1929
1928
  return e ? [new c(o.UNEXPECTED_NAME, "An Indexes shouldn't have a name", e)] : [];
@@ -1949,8 +1948,8 @@ class Ln {
1949
1948
  const s = [], i = [n.callee, ...n.args];
1950
1949
  return I.last(i) instanceof P && s.push(...this.validateFieldSetting(i.pop())), i.forEach((r) => {
1951
1950
  for (; r instanceof J; )
1952
- r.argumentList && !Ge(r.argumentList).isOk() && s.push(new c(o.INVALID_INDEXES_FIELD, "An index field must be an identifier, a quoted identifier, a functional expression or a tuple of such", r.argumentList)), r = r.callee;
1953
- Ge(r).isOk() || s.push(new c(o.INVALID_INDEXES_FIELD, "An index field must be an identifier, a quoted identifier, a functional expression or a tuple of such", r));
1951
+ r.argumentList && !Xe(r.argumentList).isOk() && s.push(new c(o.INVALID_INDEXES_FIELD, "An index field must be an identifier, a quoted identifier, a functional expression or a tuple of such", r.argumentList)), r = r.callee;
1952
+ Xe(r).isOk() || s.push(new c(o.INVALID_INDEXES_FIELD, "An index field must be an identifier, a quoted identifier, a functional expression or a tuple of such", r));
1954
1953
  }), s;
1955
1954
  });
1956
1955
  }
@@ -1991,7 +1990,7 @@ class Ln {
1991
1990
  });
1992
1991
  }
1993
1992
  }
1994
- class gn {
1993
+ class _n {
1995
1994
  constructor(e, n, s) {
1996
1995
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
1997
1996
  }
@@ -1999,7 +1998,7 @@ class gn {
1999
1998
  return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.validateBody(this.declarationNode.body)];
2000
1999
  }
2001
2000
  validateContext() {
2002
- return !(this.declarationNode.parent instanceof G) && ![b.Table, b.Project].includes(Ae(this.declarationNode.parent).unwrap_or(void 0)) ? [new c(o.INVALID_NOTE_CONTEXT, "A Note can only appear inside a Table or a Project. Sticky note can only appear at the global scope.", this.declarationNode)] : [];
2001
+ return !(this.declarationNode.parent instanceof G) && ![b.Table, b.Project].includes(ve(this.declarationNode.parent).unwrap_or(void 0)) ? [new c(o.INVALID_NOTE_CONTEXT, "A Note can only appear inside a Table or a Project. Sticky note can only appear at the global scope.", this.declarationNode)] : [];
2003
2002
  }
2004
2003
  validateName(e) {
2005
2004
  if (!(this.declarationNode.parent instanceof G))
@@ -2009,7 +2008,7 @@ class gn {
2009
2008
  const n = C(e);
2010
2009
  if (!n.isOk())
2011
2010
  return [new c(o.INVALID_NAME, "Invalid name for sticky note ", this.declarationNode)];
2012
- const i = n.unwrap().join("."), r = Yt(i);
2011
+ const i = n.unwrap().join("."), r = zt(i);
2013
2012
  return this.publicSymbolTable.has(r) ? [new c(o.DUPLICATE_NAME, `Sticky note "${i}" has already been defined`, e)] : (this.publicSymbolTable.set(r, this.declarationNode.symbol), []);
2014
2013
  }
2015
2014
  validateAlias(e) {
@@ -2039,7 +2038,7 @@ class gn {
2039
2038
  });
2040
2039
  }
2041
2040
  }
2042
- class _n {
2041
+ class An {
2043
2042
  constructor(e, n, s) {
2044
2043
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
2045
2044
  }
@@ -2050,7 +2049,7 @@ class _n {
2050
2049
  return this.declarationNode.parent instanceof A ? [new c(o.INVALID_PROJECT_CONTEXT, "A Project can only appear top-level", this.declarationNode)] : [];
2051
2050
  }
2052
2051
  validateName(e) {
2053
- return e ? Pe(e) ? [] : [new c(o.INVALID_NAME, "A Project's name is optional or must be an identifier or a quoted identifer", e)] : [];
2052
+ return e ? Me(e) ? [] : [new c(o.INVALID_NAME, "A Project's name is optional or must be an identifier or a quoted identifer", e)] : [];
2054
2053
  }
2055
2054
  validateAlias(e) {
2056
2055
  return e ? [new c(o.UNEXPECTED_ALIAS, "A Project shouldn't have an alias", e)] : [];
@@ -2078,7 +2077,7 @@ class _n {
2078
2077
  });
2079
2078
  }
2080
2079
  }
2081
- class An {
2080
+ class vn {
2082
2081
  constructor(e, n, s) {
2083
2082
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
2084
2083
  }
@@ -2089,7 +2088,7 @@ class An {
2089
2088
  return this.declarationNode.parent instanceof G ? [] : [new c(o.INVALID_REF_CONTEXT, "A Ref must appear top-level", this.declarationNode)];
2090
2089
  }
2091
2090
  validateName(e) {
2092
- return e ? Pe(e) ? [] : [new c(o.INVALID_NAME, "A Ref's name is optional or must be an identifier or a quoted identifer", e)] : [];
2091
+ return e ? Me(e) ? [] : [new c(o.INVALID_NAME, "A Ref's name is optional or must be an identifier or a quoted identifer", e)] : [];
2093
2092
  }
2094
2093
  validateAlias(e) {
2095
2094
  return e ? [new c(o.UNEXPECTED_ALIAS, "A Ref shouldn't have an alias", e)] : [];
@@ -2110,7 +2109,7 @@ class An {
2110
2109
  return [new c(o.EMPTY_REF, "A Ref must have at least one field", this.declarationNode)];
2111
2110
  const n = [];
2112
2111
  return e.length > 1 && n.push(...e.slice(1).map((s) => new c(o.REF_REDEFINED, "A Ref can only contain one binary relationship", s))), e.forEach((s) => {
2113
- s.callee && !Nn(s.callee) && n.push(new c(o.INVALID_REF_FIELD, "A Ref field must be a binary relationship", s.callee)), s.callee && !mn(s.callee) && n.push(new c(o.UNEQUAL_FIELDS_BINARY_REF, "Unequal fields in ref endpoints", s.callee));
2112
+ s.callee && !mn(s.callee) && n.push(new c(o.INVALID_REF_FIELD, "A Ref field must be a binary relationship", s.callee)), s.callee && !Tn(s.callee) && n.push(new c(o.UNEQUAL_FIELDS_BINARY_REF, "Unequal fields in ref endpoints", s.callee));
2114
2113
  const i = [...s.args];
2115
2114
  I.last(i) instanceof P ? (this.validateFieldSettings(I.last(i)), i.pop()) : i[0] instanceof P && (n.push(...this.validateFieldSettings(i[0])), i.shift()), i.length > 0 && n.push(...i.map((r) => new c(o.INVALID_REF_FIELD, "A Ref field should only have a single binary relationship", r)));
2116
2115
  }), n;
@@ -2123,7 +2122,7 @@ class An {
2123
2122
  case "delete":
2124
2123
  case "update":
2125
2124
  a.length > 1 && a.forEach((l) => s.push(new c(o.DUPLICATE_REF_SETTING, `'${r}' can only appear once`, l))), a.forEach((l) => {
2126
- vn(l.value) || s.push(new c(o.INVALID_REF_SETTING_VALUE, `'${r}' can only have values "cascade", "no action", "set null", "set default" or "restrict"`, l));
2125
+ wn(l.value) || s.push(new c(o.INVALID_REF_SETTING_VALUE, `'${r}' can only have values "cascade", "no action", "set null", "set default" or "restrict"`, l));
2127
2126
  });
2128
2127
  break;
2129
2128
  default:
@@ -2141,7 +2140,7 @@ class An {
2141
2140
  });
2142
2141
  }
2143
2142
  }
2144
- function vn(t) {
2143
+ function wn(t) {
2145
2144
  if (!(M(t) && t.expression.variable.kind !== u.QUOTED_STRING) && !(t instanceof $))
2146
2145
  return !1;
2147
2146
  let e;
@@ -2158,7 +2157,7 @@ function vn(t) {
2158
2157
  }
2159
2158
  return !1;
2160
2159
  }
2161
- class wn {
2160
+ class yn {
2162
2161
  constructor(e, n, s) {
2163
2162
  this.declarationNode = e, this.symbolFactory = s, this.publicSymbolTable = n;
2164
2163
  }
@@ -2169,10 +2168,10 @@ class wn {
2169
2168
  return this.declarationNode.parent instanceof A ? [new c(o.INVALID_TABLE_CONTEXT, "Table must appear top-level", this.declarationNode)] : [];
2170
2169
  }
2171
2170
  validateName(e) {
2172
- return e ? e instanceof ce ? [new c(o.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", e)] : Je(e) ? [] : [new c(o.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", e)] : [new c(o.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
2171
+ return e ? e instanceof ce ? [new c(o.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", e)] : Ze(e) ? [] : [new c(o.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", e)] : [new c(o.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
2173
2172
  }
2174
2173
  validateAlias(e) {
2175
- return e ? Sn(e) ? [] : [new c(o.INVALID_ALIAS, "Table aliases can only contains alphanumeric and underscore unless surrounded by double quotes", e)] : [];
2174
+ return e ? On(e) ? [] : [new c(o.INVALID_ALIAS, "Table aliases can only contains alphanumeric and underscore unless surrounded by double quotes", e)] : [];
2176
2175
  }
2177
2176
  validateSettingList(e) {
2178
2177
  const n = W(e), s = n.getErrors(), i = n.getValue();
@@ -2181,7 +2180,7 @@ class wn {
2181
2180
  switch (r) {
2182
2181
  case "headercolor":
2183
2182
  a.length > 1 && s.push(...a.map((l) => new c(o.DUPLICATE_TABLE_SETTING, "'headercolor' can only appear once", l))), a.forEach((l) => {
2184
- On(l.value) || s.push(new c(o.INVALID_TABLE_SETTING, "'headercolor' must be a color literal", l.value || l.name));
2183
+ Rn(l.value) || s.push(new c(o.INVALID_TABLE_SETTING, "'headercolor' must be a color literal", l.value || l.name));
2185
2184
  });
2186
2185
  break;
2187
2186
  case "note":
@@ -2197,14 +2196,14 @@ class wn {
2197
2196
  }
2198
2197
  registerElement() {
2199
2198
  const e = [];
2200
- this.declarationNode.symbol = this.symbolFactory.create(_t, { declaration: this.declarationNode, symbolTable: new ve() });
2199
+ this.declarationNode.symbol = this.symbolFactory.create(At, { declaration: this.declarationNode, symbolTable: new we() });
2201
2200
  const { name: n, alias: s } = this.declarationNode, i = C(n);
2202
2201
  if (i.isOk()) {
2203
- const r = [...i.unwrap()], a = r.pop(), l = Ze(r, this.publicSymbolTable, this.symbolFactory), p = xe(a);
2202
+ const r = [...i.unwrap()], a = r.pop(), l = Ke(r, this.publicSymbolTable, this.symbolFactory), p = Se(a);
2204
2203
  l.has(p) && e.push(new c(o.DUPLICATE_NAME, `Table name '${a}' already exists in schema '${r.join(".") || "public"}'`, n)), l.set(p, this.declarationNode.symbol);
2205
2204
  }
2206
- if (s && Pe(s) && !kn(s.expression.variable.value, i.unwrap_or([]))) {
2207
- const r = V(s).unwrap(), a = xe(r);
2205
+ if (s && Me(s) && !xn(s.expression.variable.value, i.unwrap_or([]))) {
2206
+ const r = V(s).unwrap(), a = Se(r);
2208
2207
  this.publicSymbolTable.has(a) && e.push(new c(o.DUPLICATE_NAME, `Table name '${r}' already exists`, n)), this.publicSymbolTable.set(a, this.declarationNode.symbol);
2209
2208
  }
2210
2209
  return e;
@@ -2222,14 +2221,14 @@ class wn {
2222
2221
  if (!n.callee)
2223
2222
  return [];
2224
2223
  const s = [];
2225
- n.args.length === 0 && s.push(new c(o.INVALID_COLUMN, "A column must have a type", n.callee)), M(n.callee) || s.push(new c(o.INVALID_COLUMN_NAME, "A column name must be an identifier or a quoted identifier", n.callee)), n.args[0] && !yn(n.args[0]) && s.push(new c(o.INVALID_COLUMN_TYPE, "Invalid column type", n.args[0]));
2224
+ n.args.length === 0 && s.push(new c(o.INVALID_COLUMN, "A column must have a type", n.callee)), M(n.callee) || s.push(new c(o.INVALID_COLUMN_NAME, "A column name must be an identifier or a quoted identifier", n.callee)), n.args[0] && !kn(n.args[0]) && s.push(new c(o.INVALID_COLUMN_TYPE, "Invalid column type", n.args[0]));
2226
2225
  const i = n.args.slice(1);
2227
2226
  return s.push(...this.validateFieldSetting(i)), s.push(...this.registerField(n)), s;
2228
2227
  });
2229
2228
  }
2230
2229
  registerField(e) {
2231
2230
  if (e.callee && M(e.callee)) {
2232
- const n = V(e.callee).unwrap(), s = We(n), i = this.symbolFactory.create(Kt, { declaration: e });
2231
+ const n = V(e.callee).unwrap(), s = Ye(n), i = this.symbolFactory.create(en, { declaration: e });
2233
2232
  e.symbol = i;
2234
2233
  const r = this.declarationNode.symbol.symbolTable;
2235
2234
  if (r.has(s)) {
@@ -2272,7 +2271,7 @@ class wn {
2272
2271
  break;
2273
2272
  case "ref":
2274
2273
  h.forEach((f) => {
2275
- Dn(f.value) || i.push(new c(o.INVALID_COLUMN_SETTING_VALUE, "'ref' must be a valid unary relationship", f.value || f.name));
2274
+ Pn(f.value) || i.push(new c(o.INVALID_COLUMN_SETTING_VALUE, "'ref' must be a valid unary relationship", f.value || f.name));
2276
2275
  });
2277
2276
  break;
2278
2277
  case "primary key":
@@ -2309,7 +2308,7 @@ class wn {
2309
2308
  break;
2310
2309
  case "default":
2311
2310
  h.length > 1 && i.push(...h.map((f) => new c(o.DUPLICATE_TABLE_SETTING, "'default' can only appear once", f))), h.forEach((f) => {
2312
- Rn(f.value) || i.push(new c(o.INVALID_TABLE_SETTING, "'default' must be a string literal, number literal, function expression, true, false or null", f.value || f.name));
2311
+ Dn(f.value) || i.push(new c(o.INVALID_TABLE_SETTING, "'default' must be a string literal, number literal, function expression, true, false or null", f.value || f.name));
2313
2312
  });
2314
2313
  break;
2315
2314
  default:
@@ -2331,8 +2330,8 @@ class wn {
2331
2330
  return s.length > 1 && (n.push(...s.map((i) => new c(o.NOTE_REDEFINED, "Duplicate notes are defined", i))), n.push()), n;
2332
2331
  }
2333
2332
  }
2334
- function yn(t) {
2335
- if (!(t instanceof J || He(t) || t instanceof D || t instanceof ce))
2333
+ function kn(t) {
2334
+ if (!(t instanceof J || Je(t) || t instanceof D || t instanceof ce))
2336
2335
  return !1;
2337
2336
  if (t instanceof J) {
2338
2337
  if (t.callee === void 0 || t.argumentList === void 0 || !t.argumentList.elementList.every((n) => ue(n) || Y(n) || Ee(n)))
@@ -2347,10 +2346,10 @@ function yn(t) {
2347
2346
  const e = C(t).unwrap_or(void 0);
2348
2347
  return e !== void 0 && e.length > 0;
2349
2348
  }
2350
- function kn(t, e) {
2349
+ function xn(t, e) {
2351
2350
  return e.length === 1 && t === e[0];
2352
2351
  }
2353
- class xn {
2352
+ class Sn {
2354
2353
  constructor(e, n, s) {
2355
2354
  this.declarationNode = e, this.publicSymbolTable = n, this.symbolFactory = s;
2356
2355
  }
@@ -2361,17 +2360,17 @@ class xn {
2361
2360
  return this.declarationNode.parent instanceof A ? [new c(o.INVALID_TABLEGROUP_CONTEXT, "TableGroup must appear top-level", this.declarationNode)] : [];
2362
2361
  }
2363
2362
  validateName(e) {
2364
- return e ? Je(e) ? [] : [new c(o.INVALID_NAME, "A TableGroup name must be of the form <tablegroup> or <schema>.<tablegroup>", e)] : [new c(o.NAME_NOT_FOUND, "A TableGroup must have a name", this.declarationNode)];
2363
+ return e ? Ze(e) ? [] : [new c(o.INVALID_NAME, "A TableGroup name must be of the form <tablegroup> or <schema>.<tablegroup>", e)] : [new c(o.NAME_NOT_FOUND, "A TableGroup must have a name", this.declarationNode)];
2365
2364
  }
2366
2365
  validateAlias(e) {
2367
2366
  return e ? [new c(o.UNEXPECTED_ALIAS, "A TableGroup shouldn't have an alias", e)] : [];
2368
2367
  }
2369
2368
  registerElement() {
2370
2369
  const { name: e } = this.declarationNode;
2371
- this.declarationNode.symbol = this.symbolFactory.create(en, { declaration: this.declarationNode, symbolTable: new ve() });
2370
+ this.declarationNode.symbol = this.symbolFactory.create(tn, { declaration: this.declarationNode, symbolTable: new we() });
2372
2371
  const n = C(e);
2373
2372
  if (n.isOk()) {
2374
- const s = n.unwrap(), i = s.pop(), r = Ze(s, this.publicSymbolTable, this.symbolFactory), a = ze(i);
2373
+ const s = n.unwrap(), i = s.pop(), r = Ke(s, this.publicSymbolTable, this.symbolFactory), a = qe(i);
2375
2374
  if (r.has(a))
2376
2375
  return [new c(o.DUPLICATE_NAME, `TableGroup name '${i}' already exists in schema '${s.join(".") || "public"}'`, e)];
2377
2376
  r.set(a, this.declarationNode.symbol);
@@ -2405,7 +2404,7 @@ class xn {
2405
2404
  }
2406
2405
  registerField(e) {
2407
2406
  if (e.callee && M(e.callee)) {
2408
- const n = V(e.callee).unwrap(), s = Qe(n), i = this.symbolFactory.create(tn, { declaration: e });
2407
+ const n = V(e.callee).unwrap(), s = He(n), i = this.symbolFactory.create(nn, { declaration: e });
2409
2408
  e.symbol = i;
2410
2409
  const r = this.declarationNode.symbol.symbolTable;
2411
2410
  if (r.has(s)) {
@@ -2420,59 +2419,59 @@ class xn {
2420
2419
  return [];
2421
2420
  }
2422
2421
  }
2423
- const vt = ["-", "+"];
2422
+ const wt = ["-", "+"];
2424
2423
  function re(t) {
2425
2424
  switch (t.type.value.toLowerCase()) {
2426
2425
  case b.Enum:
2427
- return In;
2426
+ return Ln;
2428
2427
  case b.Table:
2429
- return wn;
2428
+ return yn;
2430
2429
  case b.TableGroup:
2431
- return xn;
2430
+ return Sn;
2432
2431
  case b.Project:
2433
- return _n;
2434
- case b.Ref:
2435
2432
  return An;
2433
+ case b.Ref:
2434
+ return vn;
2436
2435
  case b.Note:
2437
- return gn;
2436
+ return _n;
2438
2437
  case b.Indexes:
2439
- return Ln;
2438
+ return gn;
2440
2439
  default:
2441
- return bn;
2440
+ return In;
2442
2441
  }
2443
2442
  }
2444
- function Je(t) {
2443
+ function Ze(t) {
2445
2444
  return !!C(t).unwrap_or(!1);
2446
2445
  }
2447
- function Sn(t) {
2448
- return Pe(t);
2446
+ function On(t) {
2447
+ return Me(t);
2449
2448
  }
2450
- function Pe(t) {
2449
+ function Me(t) {
2451
2450
  return t instanceof D && t.expression instanceof j;
2452
2451
  }
2453
- function Ze(t, e, n) {
2452
+ function Ke(t, e, n) {
2454
2453
  var i;
2455
2454
  t[0] === "public" && (t = t.slice(1));
2456
2455
  let s = e;
2457
2456
  for (const r of t) {
2458
2457
  let a;
2459
- const l = $e(r);
2458
+ const l = je(r);
2460
2459
  if (s.has(l)) {
2461
2460
  if (a = (i = s.get(l)) == null ? void 0 : i.symbolTable, !a)
2462
2461
  throw new Error("Expect a symbol table in a schema symbol");
2463
2462
  } else {
2464
- a = new ve();
2465
- const p = n.create(gt, { symbolTable: a });
2463
+ a = new we();
2464
+ const p = n.create(_t, { symbolTable: a });
2466
2465
  s.set(l, p);
2467
2466
  }
2468
2467
  s = a;
2469
2468
  }
2470
2469
  return s;
2471
2470
  }
2472
- function wt(t) {
2471
+ function yt(t) {
2473
2472
  return t === "-" || t === "<>" || t === ">" || t === "<";
2474
2473
  }
2475
- function On(t) {
2474
+ function Rn(t) {
2476
2475
  var n;
2477
2476
  if (!(t instanceof D) || !(t.expression instanceof me) || ((n = t.expression.literal) == null ? void 0 : n.kind) !== u.COLOR_LITERAL)
2478
2477
  return !1;
@@ -2480,29 +2479,29 @@ function On(t) {
2480
2479
  if (e.length !== 4 && e.length !== 7 || e[0] !== "#")
2481
2480
  return !1;
2482
2481
  for (let s = 1; s < e.length; s += 1)
2483
- if (!qt(e[s]))
2482
+ if (!Ht(e[s]))
2484
2483
  return !1;
2485
2484
  return !0;
2486
2485
  }
2487
2486
  function le(t) {
2488
2487
  return t === void 0;
2489
2488
  }
2490
- function Rn(t) {
2489
+ function Dn(t) {
2491
2490
  var e;
2492
- return !!(Y(t) || ue(t) || Ee(t) && ["true", "false", "null"].includes(t.expression.variable.value.toLowerCase()) || t instanceof q && vt.includes((e = t.op) == null ? void 0 : e.value) && ue(t.expression) || t instanceof te);
2491
+ return !!(Y(t) || ue(t) || Ee(t) && ["true", "false", "null"].includes(t.expression.variable.value.toLowerCase()) || t instanceof q && wt.includes((e = t.op) == null ? void 0 : e.value) && ue(t.expression) || t instanceof te);
2493
2492
  }
2494
2493
  function ue(t) {
2495
2494
  var e;
2496
2495
  return t instanceof D && t.expression instanceof me && ((e = t.expression.literal) == null ? void 0 : e.kind) === u.NUMERIC_LITERAL;
2497
2496
  }
2498
- function Dn(t) {
2497
+ function Pn(t) {
2499
2498
  var n;
2500
- if (!(t instanceof q) || !wt((n = t.op) == null ? void 0 : n.value))
2499
+ if (!(t instanceof q) || !yt((n = t.op) == null ? void 0 : n.value))
2501
2500
  return !1;
2502
2501
  const e = C(t.expression).unwrap_or(void 0);
2503
2502
  return e !== void 0 && e.length > 0;
2504
2503
  }
2505
- function yt(t) {
2504
+ function kt(t) {
2506
2505
  return t instanceof Z && t.elementList.every(M);
2507
2506
  }
2508
2507
  function W(t) {
@@ -2522,10 +2521,10 @@ function W(t) {
2522
2521
  }
2523
2522
  return new F(e, n);
2524
2523
  }
2525
- class ht {
2524
+ class ft {
2526
2525
  constructor(e, n) {
2527
- this.ast = e, this.symbolFactory = n, this.publicSchemaSymbol = this.symbolFactory.create(gt, {
2528
- symbolTable: new ve()
2526
+ this.ast = e, this.symbolFactory = n, this.publicSchemaSymbol = this.symbolFactory.create(_t, {
2527
+ symbolTable: new we()
2529
2528
  }), this.ast.symbol = this.publicSchemaSymbol, this.ast.symbol.declaration = this.ast;
2530
2529
  }
2531
2530
  validate() {
@@ -2540,7 +2539,7 @@ class ht {
2540
2539
  );
2541
2540
  e.push(...r.validate());
2542
2541
  });
2543
- const n = this.ast.body.filter((s) => Ae(s).unwrap_or(void 0) === b.Project);
2542
+ const n = this.ast.body.filter((s) => ve(s).unwrap_or(void 0) === b.Project);
2544
2543
  return n.length > 1 && n.forEach((s) => e.push(new c(o.PROJECT_REDEFINED, "Only one project can exist", s))), new F(this.ast, e);
2545
2544
  }
2546
2545
  }
@@ -2573,7 +2572,7 @@ class ae {
2573
2572
  if (s instanceof A) {
2574
2573
  if (!s.type)
2575
2574
  continue;
2576
- const i = kt(s);
2575
+ const i = xt(s);
2577
2576
  new i(s, this.errors).bind();
2578
2577
  } else
2579
2578
  this.bindSubfield(s);
@@ -2596,7 +2595,7 @@ class ae {
2596
2595
  return;
2597
2596
  this.bindFragments([e], n);
2598
2597
  } else
2599
- e instanceof H ? He(e) ? this.bindFragments(he(e).unwrap_or([]), n) : (this.scanAndBind(e.leftExpression, n), this.scanAndBind(e.rightExpression, n)) : e instanceof q ? this.scanAndBind(e.expression, n) : e instanceof De ? this.scanAndBind(e.expression, n) : e instanceof Z && e.elementList.forEach((r) => this.scanAndBind(r, n));
2598
+ e instanceof H ? Je(e) ? this.bindFragments(he(e).unwrap_or([]), n) : (this.scanAndBind(e.leftExpression, n), this.scanAndBind(e.rightExpression, n)) : e instanceof q ? this.scanAndBind(e.expression, n) : e instanceof Pe ? this.scanAndBind(e.expression, n) : e instanceof Z && e.elementList.forEach((r) => this.scanAndBind(r, n));
2600
2599
  }
2601
2600
  // Bind the fragments of a member access expression
2602
2601
  // which can be a simple expression like v1.User,
@@ -2604,7 +2603,7 @@ class ae {
2604
2603
  bindFragments(e, n) {
2605
2604
  if (e.length === 0)
2606
2605
  return;
2607
- const s = [...n.topSubnamesSymbolKind], { remainingSubnamesSymbolKind: i } = n, r = e.findIndex((f) => !M(f)), l = r !== -1 && yt(e[r]) ? e[r] : void 0, p = r >= 0 ? s.pop() : void 0, h = e.slice(
2606
+ const s = [...n.topSubnamesSymbolKind], { remainingSubnamesSymbolKind: i } = n, r = e.findIndex((f) => !M(f)), l = r !== -1 && kt(e[r]) ? e[r] : void 0, p = r >= 0 ? s.pop() : void 0, h = e.slice(
2608
2607
  0,
2609
2608
  r === -1 ? void 0 : r
2610
2609
  );
@@ -2614,14 +2613,14 @@ class ae {
2614
2613
  for (; s.length && h.length; ) {
2615
2614
  const f = s.pop(), N = h.pop(), g = V(N).unwrap();
2616
2615
  T.unshift({
2617
- index: Fe(g, f),
2616
+ index: Ve(g, f),
2618
2617
  referrer: N
2619
2618
  });
2620
2619
  }
2621
2620
  for (; h.length; ) {
2622
2621
  const f = h.pop(), N = V(f).unwrap();
2623
2622
  T.unshift({
2624
- index: Fe(N, i),
2623
+ index: Ve(N, i),
2625
2624
  referrer: f
2626
2625
  });
2627
2626
  }
@@ -2630,7 +2629,7 @@ class ae {
2630
2629
  [
2631
2630
  ...T,
2632
2631
  {
2633
- index: Fe(
2632
+ index: Ve(
2634
2633
  V(f).unwrap(),
2635
2634
  p
2636
2635
  ),
@@ -2646,7 +2645,7 @@ class ae {
2646
2645
  resolveIndexStack(e, n) {
2647
2646
  if (e.length === 0)
2648
2647
  throw new Error("Unreachable - An unresolved name must have at least one name component");
2649
- const [s, ...i] = e, r = Tn(s.index, this.declarationNode);
2648
+ const [s, ...i] = e, r = bn(s.index, this.declarationNode);
2650
2649
  if (r === void 0) {
2651
2650
  const { kind: h, name: T } = ie(s.index).unwrap();
2652
2651
  this.logError(s.referrer, `Can not find ${h} '${T}'`, n);
@@ -2673,7 +2672,7 @@ class ae {
2673
2672
  s || this.errors.push(new c(o.BINDING_ERROR, n, e));
2674
2673
  }
2675
2674
  }
2676
- class Pn extends ae {
2675
+ class Un extends ae {
2677
2676
  constructor() {
2678
2677
  super(...arguments), this.subfield = {
2679
2678
  arg: {
@@ -2683,7 +2682,7 @@ class Pn extends ae {
2683
2682
  }, this.settingList = {};
2684
2683
  }
2685
2684
  }
2686
- class Un extends ae {
2685
+ class Mn extends ae {
2687
2686
  constructor() {
2688
2687
  super(...arguments), this.subfield = {
2689
2688
  arg: {
@@ -2693,7 +2692,7 @@ class Un extends ae {
2693
2692
  }, this.settingList = {};
2694
2693
  }
2695
2694
  }
2696
- class Mn extends ae {
2695
+ class Fn extends ae {
2697
2696
  constructor() {
2698
2697
  super(...arguments), this.subfield = {
2699
2698
  arg: {
@@ -2728,7 +2727,7 @@ class Mn extends ae {
2728
2727
  }, this.settingList = {};
2729
2728
  }
2730
2729
  }
2731
- class Fn extends ae {
2730
+ class Bn extends ae {
2732
2731
  constructor() {
2733
2732
  super(...arguments), this.subfield = {
2734
2733
  arg: {
@@ -2738,7 +2737,7 @@ class Fn extends ae {
2738
2737
  }, this.settingList = {};
2739
2738
  }
2740
2739
  }
2741
- class Bn extends ae {
2740
+ class Vn extends ae {
2742
2741
  constructor() {
2743
2742
  super(...arguments), this.subfield = {
2744
2743
  arg: {
@@ -2748,7 +2747,7 @@ class Bn extends ae {
2748
2747
  }, this.settingList = {};
2749
2748
  }
2750
2749
  }
2751
- class Vn extends ae {
2750
+ class Gn extends ae {
2752
2751
  constructor() {
2753
2752
  super(...arguments), this.subfield = {
2754
2753
  arg: {
@@ -2765,7 +2764,7 @@ class Vn extends ae {
2765
2764
  }, this.settingList = {};
2766
2765
  }
2767
2766
  }
2768
- class Gn extends ae {
2767
+ class Cn extends ae {
2769
2768
  constructor() {
2770
2769
  super(...arguments), this.subfield = {
2771
2770
  arg: {
@@ -2793,7 +2792,7 @@ class Gn extends ae {
2793
2792
  }, this.settingList = {};
2794
2793
  }
2795
2794
  }
2796
- class Cn extends ae {
2795
+ class Xn extends ae {
2797
2796
  constructor() {
2798
2797
  super(...arguments), this.subfield = {
2799
2798
  arg: {
@@ -2810,40 +2809,40 @@ class Cn extends ae {
2810
2809
  }, this.settingList = {};
2811
2810
  }
2812
2811
  }
2813
- function kt(t) {
2812
+ function xt(t) {
2814
2813
  switch (t.type.value.toLowerCase()) {
2815
2814
  case b.Enum:
2816
- return Un;
2815
+ return Mn;
2817
2816
  case b.Table:
2818
- return Gn;
2819
- case b.TableGroup:
2820
2817
  return Cn;
2818
+ case b.TableGroup:
2819
+ return Xn;
2821
2820
  case b.Project:
2822
- return Bn;
2823
- case b.Ref:
2824
2821
  return Vn;
2822
+ case b.Ref:
2823
+ return Gn;
2825
2824
  case b.Note:
2826
- return Fn;
2825
+ return Bn;
2827
2826
  case b.Indexes:
2828
- return Mn;
2827
+ return Fn;
2829
2828
  default:
2830
- return Pn;
2829
+ return Un;
2831
2830
  }
2832
2831
  }
2833
- class Xn {
2832
+ class $n {
2834
2833
  constructor(e) {
2835
2834
  this.ast = e, this.errors = [];
2836
2835
  }
2837
2836
  resolve() {
2838
2837
  for (const e of this.ast.body)
2839
2838
  if (e.type) {
2840
- const n = kt(e);
2839
+ const n = xt(e);
2841
2840
  new n(e, this.errors).bind();
2842
2841
  }
2843
2842
  return new F(this.ast, this.errors);
2844
2843
  }
2845
2844
  }
2846
- class $n {
2845
+ class Wn {
2847
2846
  constructor(e) {
2848
2847
  this.generator = e;
2849
2848
  }
@@ -2851,21 +2850,21 @@ class $n {
2851
2850
  return new e(n, this.generator.nextId());
2852
2851
  }
2853
2852
  }
2854
- class Wn {
2853
+ class jn {
2855
2854
  constructor(e, n) {
2856
- this.ast = e, this.symbolFactory = new $n(n);
2855
+ this.ast = e, this.symbolFactory = new Wn(n);
2857
2856
  }
2858
2857
  // Analyzing: Invoking both the validator and binder
2859
2858
  analyze() {
2860
- return new ht(this.ast, this.symbolFactory).validate().chain((n) => new Xn(n).resolve());
2859
+ return new ft(this.ast, this.symbolFactory).validate().chain((n) => new $n(n).resolve());
2861
2860
  }
2862
2861
  // For invoking the validator only
2863
2862
  validate() {
2864
- return new ht(this.ast, this.symbolFactory).validate().chain((n) => new F(n, []));
2863
+ return new ft(this.ast, this.symbolFactory).validate().chain((n) => new F(n, []));
2865
2864
  }
2866
2865
  }
2867
- function ft(t, e) {
2868
- const { variables: n, tupleElements: s } = ge(t).unwrap();
2866
+ function pt(t, e) {
2867
+ const { variables: n, tupleElements: s } = _e(t).unwrap();
2869
2868
  return s ? n.length === 0 ? {
2870
2869
  schemaName: e.schemaName,
2871
2870
  tableName: e.name,
@@ -2884,7 +2883,7 @@ function ft(t, e) {
2884
2883
  schemaName: n.pop() || null
2885
2884
  };
2886
2885
  }
2887
- function xt(t) {
2886
+ function St(t) {
2888
2887
  switch (t) {
2889
2888
  case "<":
2890
2889
  return ["1", "*"];
@@ -2907,7 +2906,7 @@ function x(t) {
2907
2906
  end: { offset: t.endPos.offset, line: t.endPos.line + 1, column: t.endPos.column + 1 }
2908
2907
  };
2909
2908
  }
2910
- function Ce(t) {
2909
+ function $e(t) {
2911
2910
  var n;
2912
2911
  const e = (n = he(t).unwrap_or(void 0)) == null ? void 0 : n.pop();
2913
2912
  return e instanceof Z ? e.elementList.map((s) => s.referee) : [e.referee];
@@ -2919,18 +2918,18 @@ function Te(t) {
2919
2918
  schemaName: e
2920
2919
  };
2921
2920
  }
2922
- function St(t) {
2921
+ function Ot(t) {
2923
2922
  return t.expression.literal.value;
2924
2923
  }
2925
- function Ot(t, e) {
2924
+ function Rt(t, e) {
2926
2925
  if (Array.isArray(t)) {
2927
2926
  const i = t.map(({ id: a }) => a).sort().join(","), r = e.map(({ id: a }) => a).sort().join(",");
2928
2927
  return i < r ? `${i}-${r}` : `${r}-${i}`;
2929
2928
  }
2930
- const n = t.id, s = e.id;
2929
+ const n = t.id.toString(), s = e.id.toString();
2931
2930
  return n < s ? `${n}-${s}` : `${s}-${n}`;
2932
2931
  }
2933
- function Rt(t, e) {
2932
+ function Dt(t, e) {
2934
2933
  if (Array.isArray(t)) {
2935
2934
  const i = t.map(({ id: a }) => a).sort(), r = e.map(({ id: a }) => a).sort();
2936
2935
  return I.zip(i, r).every(([a, l]) => a === l);
@@ -2938,7 +2937,13 @@ function Rt(t, e) {
2938
2937
  const n = t.id, s = e.id;
2939
2938
  return n === s;
2940
2939
  }
2941
- class Dt {
2940
+ function ge(t) {
2941
+ const e = t.split(`
2942
+ `), n = e.filter((i) => i.trimStart()), s = Math.min(...n.map((i) => i.length - i.trimStart().length));
2943
+ return e.map((i) => i.slice(s)).join(`
2944
+ `);
2945
+ }
2946
+ class Pt {
2942
2947
  constructor(e, n) {
2943
2948
  this.declarationNode = e, this.env = n, this.table = { name: void 0, schemaName: void 0, alias: null, fields: [], token: void 0, indexes: [] }, this.pkColumns = [];
2944
2949
  }
@@ -2979,12 +2984,12 @@ class Dt {
2979
2984
  }), this.table.alias = n), [];
2980
2985
  }
2981
2986
  interpretSettingList(e) {
2982
- var r, a, l;
2987
+ var i, r, a;
2983
2988
  const n = W(e).getValue();
2984
- this.table.headerColor = (r = n.headercolor) != null && r.length ? St((l = (a = n.headercolor) == null ? void 0 : a.at(0)) == null ? void 0 : l.value) : void 0;
2985
- const [s] = n.note || [], i = Q(s == null ? void 0 : s.value).unwrap_or(void 0);
2989
+ this.table.headerColor = (i = n.headercolor) != null && i.length ? Ot((a = (r = n.headercolor) == null ? void 0 : r.at(0)) == null ? void 0 : a.value) : void 0;
2990
+ const [s] = n.note || [];
2986
2991
  return this.table.note = s && {
2987
- value: i,
2992
+ value: Q(s == null ? void 0 : s.value).map(ge).unwrap(),
2988
2993
  token: x(s)
2989
2994
  }, [];
2990
2995
  }
@@ -2998,7 +3003,7 @@ class Dt {
2998
3003
  switch ((s = n.type) == null ? void 0 : s.value.toLowerCase()) {
2999
3004
  case "note":
3000
3005
  return this.table.note = {
3001
- value: Q(n.body instanceof ne ? n.body.body[0].callee : n.body.callee).unwrap(),
3006
+ value: Q(n.body instanceof ne ? n.body.body[0].callee : n.body.callee).map(ge).unwrap(),
3002
3007
  token: x(n)
3003
3008
  }, [];
3004
3009
  case "indexes":
@@ -3014,23 +3019,23 @@ class Dt {
3014
3019
  var a, l, p, h, T, f, N, g;
3015
3020
  const n = [], s = {};
3016
3021
  s.name = V(e.callee).unwrap();
3017
- const i = jn(e.args[0]);
3022
+ const i = Yn(e.args[0]);
3018
3023
  s.type = i.getValue(), n.push(...i.getErrors()), s.token = x(e), s.inline_refs = [];
3019
3024
  const r = e.args.slice(1);
3020
3025
  if (I.last(r) instanceof P) {
3021
3026
  const _ = W(r.pop()).getValue();
3022
- s.pk = !!((a = _.pk) != null && a.length) || !!((l = _["primary key"]) != null && l.length), s.increment = !!((p = _.increment) != null && p.length), s.unique = !!((h = _.unique) != null && h.length), s.not_null = !!((T = _["not null"]) != null && T.length) && !0, s.dbdefault = Yn((N = (f = _.default) == null ? void 0 : f.at(0)) == null ? void 0 : N.value);
3027
+ s.pk = !!((a = _.pk) != null && a.length) || !!((l = _["primary key"]) != null && l.length), s.increment = !!((p = _.increment) != null && p.length), s.unique = !!((h = _.unique) != null && h.length), s.not_null = !!((T = _["not null"]) != null && T.length) && !0, s.dbdefault = zn((N = (f = _.default) == null ? void 0 : f.at(0)) == null ? void 0 : N.value);
3023
3028
  const K = (g = _.note) == null ? void 0 : g.at(0);
3024
3029
  s.note = K && {
3025
- value: Q(K.value).unwrap(),
3030
+ value: Q(K.value).map(ge).unwrap(),
3026
3031
  token: x(K)
3027
3032
  };
3028
3033
  const be = _.ref || [];
3029
3034
  s.inline_refs = be.flatMap((z) => {
3030
- const [tt] = Ce(z.value.expression);
3031
- if (Rt(tt, e.symbol))
3035
+ const [nt] = $e(z.value.expression);
3036
+ if (Dt(nt, e.symbol))
3032
3037
  return n.push(new c(o.SAME_ENDPOINT, "Two endpoints are the same", z)), [];
3033
- const we = z.value.op, ee = C(z.value.expression).unwrap();
3038
+ const ye = z.value.op, ee = C(z.value.expression).unwrap();
3034
3039
  let fe;
3035
3040
  if (ee.length === 1) {
3036
3041
  const [oe] = ee;
@@ -3038,7 +3043,7 @@ class Dt {
3038
3043
  schemaName: this.table.schemaName,
3039
3044
  tableName: this.table.name,
3040
3045
  fieldNames: [oe],
3041
- relation: we.value,
3046
+ relation: ye.value,
3042
3047
  token: x(z)
3043
3048
  };
3044
3049
  } else if (ee.length === 2) {
@@ -3047,16 +3052,16 @@ class Dt {
3047
3052
  schemaName: null,
3048
3053
  tableName: oe,
3049
3054
  fieldNames: [Ie],
3050
- relation: we.value,
3055
+ relation: ye.value,
3051
3056
  token: x(z)
3052
3057
  };
3053
3058
  } else if (ee.length === 3) {
3054
- const [oe, Ie, st] = ee;
3059
+ const [oe, Ie, it] = ee;
3055
3060
  fe = {
3056
3061
  schemaName: oe,
3057
3062
  tableName: Ie,
3058
- fieldNames: [st],
3059
- relation: we.value,
3063
+ fieldNames: [it],
3064
+ relation: ye.value,
3060
3065
  token: x(z)
3061
3066
  };
3062
3067
  } else {
@@ -3066,12 +3071,12 @@ class Dt {
3066
3071
  schemaName: ee.join("."),
3067
3072
  tableName: Ie,
3068
3073
  fieldNames: [oe],
3069
- relation: we.value,
3074
+ relation: ye.value,
3070
3075
  token: x(z)
3071
3076
  };
3072
3077
  }
3073
- const nt = this.registerInlineRefToEnv(e, tt, fe, z);
3074
- return n.push(...nt), nt.length === 0 ? fe : [];
3078
+ const st = this.registerInlineRefToEnv(e, nt, fe, z);
3079
+ return n.push(...st), st.length === 0 ? fe : [];
3075
3080
  });
3076
3081
  }
3077
3082
  return s.pk || (s.pk = r.some((_) => X(_).unwrap().toLowerCase() === "pk")), s.unique || (s.unique = r.some((_) => X(_).unwrap().toLowerCase() === "unique")), this.table.fields.push(s), s.pk && this.pkColumns.push(s), n;
@@ -3099,7 +3104,7 @@ class Dt {
3099
3104
  _.push(g.argumentList), g = g.callee;
3100
3105
  return _.push(g), _;
3101
3106
  }).forEach((g) => {
3102
- const { functional: _, nonFunctional: K } = Ge(g).unwrap();
3107
+ const { functional: _, nonFunctional: K } = Xe(g).unwrap();
3103
3108
  s.columns.push(
3104
3109
  ..._.map((be) => ({
3105
3110
  value: be.value.value,
@@ -3114,13 +3119,13 @@ class Dt {
3114
3119
  })), [];
3115
3120
  }
3116
3121
  registerInlineRefToEnv(e, n, s, i) {
3117
- const r = Ot(e.symbol, n);
3122
+ const r = Rt(e.symbol, n);
3118
3123
  if (this.env.refIds[r])
3119
3124
  return [
3120
3125
  new c(o.CIRCULAR_REF, "References with same endpoints exist", i),
3121
3126
  new c(o.CIRCULAR_REF, "References with same endpoints exist", this.env.refIds[r])
3122
3127
  ];
3123
- const a = xt(s.relation);
3128
+ const a = St(s.relation);
3124
3129
  return this.env.refIds[r] = i, this.env.ref.set(i, {
3125
3130
  name: null,
3126
3131
  schemaName: null,
@@ -3141,7 +3146,7 @@ class Dt {
3141
3146
  }), [];
3142
3147
  }
3143
3148
  }
3144
- function jn(t) {
3149
+ function Yn(t) {
3145
3150
  let e = null;
3146
3151
  t instanceof J && (e = t.argumentList.elementList.map((r) => ue(r) ? r.expression.literal.value : Y(r) ? Q(r).unwrap() : X(r).unwrap()).join(","), t = t.callee);
3147
3152
  let n = "";
@@ -3161,7 +3166,7 @@ function jn(t) {
3161
3166
  args: e
3162
3167
  });
3163
3168
  }
3164
- function Yn(t) {
3169
+ function zn(t) {
3165
3170
  var e, n, s;
3166
3171
  if (t) {
3167
3172
  if (Y(t))
@@ -3179,7 +3184,7 @@ function Yn(t) {
3179
3184
  value: t.expression.variable.value.toLowerCase(),
3180
3185
  type: "boolean"
3181
3186
  };
3182
- if (t instanceof q && vt.includes((e = t.op) == null ? void 0 : e.value) && ue(t.expression)) {
3187
+ if (t instanceof q && wt.includes((e = t.op) == null ? void 0 : e.value) && ue(t.expression)) {
3183
3188
  const i = Number.parseFloat(t.expression.expression.literal.value);
3184
3189
  return {
3185
3190
  value: ((n = t.op) == null ? void 0 : n.value) === "-" ? 0 - i : i,
@@ -3194,7 +3199,7 @@ function Yn(t) {
3194
3199
  throw new Error("Unreachable");
3195
3200
  }
3196
3201
  }
3197
- class zn {
3202
+ class Qn {
3198
3203
  constructor(e, n) {
3199
3204
  this.declarationNode = e, this.env = n, this.note = { name: void 0, content: void 0, token: void 0 };
3200
3205
  }
@@ -3212,7 +3217,7 @@ class zn {
3212
3217
  interpretSettingList(e) {
3213
3218
  var s, i, r;
3214
3219
  const n = W(e).getValue();
3215
- return this.note.headerColor = (s = n.headercolor) != null && s.length ? St((r = (i = n.headercolor) == null ? void 0 : i.at(0)) == null ? void 0 : r.value) : void 0, [];
3220
+ return this.note.headerColor = (s = n.headercolor) != null && s.length ? Ot((r = (i = n.headercolor) == null ? void 0 : i.at(0)) == null ? void 0 : r.value) : void 0, [];
3216
3221
  }
3217
3222
  interpretBody(e) {
3218
3223
  const [n, s] = I.partition(e.body, (i) => i instanceof w);
@@ -3222,10 +3227,10 @@ class zn {
3222
3227
  }
3223
3228
  interpretNote(e) {
3224
3229
  const n = I.get(e, "callee.expression.literal.value", "");
3225
- return this.note.content = n, [];
3230
+ return this.note.content = ge(n), [];
3226
3231
  }
3227
3232
  }
3228
- class Pt {
3233
+ class Ut {
3229
3234
  constructor(e, n) {
3230
3235
  this.declarationNode = e, this.env = n, this.container = this.declarationNode.parent instanceof A ? this.env.tables.get(this.declarationNode.parent) : void 0, this.ref = {};
3231
3236
  }
@@ -3241,10 +3246,10 @@ class Pt {
3241
3246
  }
3242
3247
  interpretField(e) {
3243
3248
  var h, T, f, N;
3244
- const n = e.callee.op.value, { leftExpression: s, rightExpression: i } = e.callee, r = Ce(s), a = Ce(i);
3245
- if (Rt(r, a))
3249
+ const n = e.callee.op.value, { leftExpression: s, rightExpression: i } = e.callee, r = $e(s), a = $e(i);
3250
+ if (Dt(r, a))
3246
3251
  return [new c(o.SAME_ENDPOINT, "Two endpoints are the same", e)];
3247
- const l = Ot(r, a);
3252
+ const l = Rt(r, a);
3248
3253
  if (this.env.refIds[l])
3249
3254
  return [
3250
3255
  new c(o.CIRCULAR_REF, "References with same endpoints exist", this.declarationNode),
@@ -3256,22 +3261,22 @@ class Pt {
3256
3261
  const K = (N = (f = g.update) == null ? void 0 : f.at(0)) == null ? void 0 : N.value;
3257
3262
  this.ref.onUpdate = K instanceof $ ? Ne(K).unwrap_or(void 0) : X(K).unwrap_or(void 0);
3258
3263
  }
3259
- const p = xt(n);
3264
+ const p = St(n);
3260
3265
  return this.ref.endpoints = [
3261
3266
  {
3262
- ...ft(s, this.container),
3267
+ ...pt(s, this.container),
3263
3268
  relation: p[0],
3264
3269
  token: x(s)
3265
3270
  },
3266
3271
  {
3267
- ...ft(i, this.container),
3272
+ ...pt(i, this.container),
3268
3273
  relation: p[1],
3269
3274
  token: x(i)
3270
3275
  }
3271
3276
  ], this.env.refIds[l] = this.declarationNode, [];
3272
3277
  }
3273
3278
  }
3274
- class Ut {
3279
+ class Mt {
3275
3280
  constructor(e, n) {
3276
3281
  this.declarationNode = e, this.env = n, this.tableGroup = { tables: [] };
3277
3282
  }
@@ -3304,7 +3309,7 @@ class Ut {
3304
3309
  }), n;
3305
3310
  }
3306
3311
  }
3307
- class Mt {
3312
+ class Ft {
3308
3313
  constructor(e, n) {
3309
3314
  this.declarationNode = e, this.env = n, this.enum = { values: [] };
3310
3315
  }
@@ -3322,13 +3327,13 @@ class Mt {
3322
3327
  i.token = x(s), i.name = X(s.callee).unwrap();
3323
3328
  const a = (l = W(s.args[0]).getValue().note) == null ? void 0 : l.at(0);
3324
3329
  return i.note = a && {
3325
- value: Q(a.value).unwrap(),
3330
+ value: Q(a.value).map(ge).unwrap(),
3326
3331
  token: x(a)
3327
3332
  }, this.enum.values.push(i), [];
3328
3333
  });
3329
3334
  }
3330
3335
  }
3331
- class Qn {
3336
+ class qn {
3332
3337
  constructor(e, n) {
3333
3338
  this.declarationNode = e, this.env = n, this.project = { enums: [], refs: [], tableGroups: [], tables: [] };
3334
3339
  }
@@ -3347,19 +3352,19 @@ class Qn {
3347
3352
  const s = n;
3348
3353
  switch ((i = s.type) == null ? void 0 : i.value.toLowerCase()) {
3349
3354
  case "table": {
3350
- const r = new Dt(s, this.env).interpret();
3355
+ const r = new Pt(s, this.env).interpret();
3351
3356
  return this.project.tables.push(this.env.tables.get(s)), r;
3352
3357
  }
3353
3358
  case "ref": {
3354
- const r = new Pt(s, this.env).interpret();
3359
+ const r = new Ut(s, this.env).interpret();
3355
3360
  return this.project.refs.push(this.env.ref.get(s)), r;
3356
3361
  }
3357
3362
  case "tablegroup": {
3358
- const r = new Ut(s, this.env).interpret();
3363
+ const r = new Mt(s, this.env).interpret();
3359
3364
  return this.project.tableGroups.push(this.env.tableGroups.get(s)), r;
3360
3365
  }
3361
3366
  case "enum": {
3362
- const r = new Mt(s, this.env).interpret();
3367
+ const r = new Ft(s, this.env).interpret();
3363
3368
  return this.project.enums.push(this.env.enums.get(s)), r;
3364
3369
  }
3365
3370
  case "note":
@@ -3373,7 +3378,7 @@ class Qn {
3373
3378
  });
3374
3379
  }
3375
3380
  }
3376
- class qn {
3381
+ class Hn {
3377
3382
  constructor(e) {
3378
3383
  this.ast = e, this.env = {
3379
3384
  schema: [],
@@ -3390,27 +3395,27 @@ class qn {
3390
3395
  }
3391
3396
  interpret() {
3392
3397
  const e = this.ast.body.flatMap((n) => {
3393
- switch (Ae(n).unwrap_or(void 0)) {
3398
+ switch (ve(n).unwrap_or(void 0)) {
3394
3399
  case b.Table:
3395
- return new Dt(n, this.env).interpret();
3400
+ return new Pt(n, this.env).interpret();
3396
3401
  case b.Note:
3397
- return new zn(n, this.env).interpret();
3402
+ return new Qn(n, this.env).interpret();
3398
3403
  case b.Ref:
3399
- return new Pt(n, this.env).interpret();
3400
- case b.TableGroup:
3401
3404
  return new Ut(n, this.env).interpret();
3402
- case b.Enum:
3405
+ case b.TableGroup:
3403
3406
  return new Mt(n, this.env).interpret();
3407
+ case b.Enum:
3408
+ return new Ft(n, this.env).interpret();
3404
3409
  case b.Project:
3405
- return new Qn(n, this.env).interpret();
3410
+ return new qn(n, this.env).interpret();
3406
3411
  default:
3407
3412
  return [];
3408
3413
  }
3409
3414
  });
3410
- return new F(Hn(this.env), e);
3415
+ return new F(Jn(this.env), e);
3411
3416
  }
3412
3417
  }
3413
- function Hn(t) {
3418
+ function Jn(t) {
3414
3419
  return {
3415
3420
  schemas: [],
3416
3421
  tables: Array.from(t.tables.values()),
@@ -3423,7 +3428,7 @@ function Hn(t) {
3423
3428
  };
3424
3429
  }
3425
3430
  var L = /* @__PURE__ */ ((t) => (t[t.Function = 1] = "Function", t[t.Constructor = 2] = "Constructor", t[t.Field = 3] = "Field", t[t.Variable = 4] = "Variable", t[t.Class = 5] = "Class", t[t.Struct = 6] = "Struct", t[t.Interface = 7] = "Interface", t[t.Module = 8] = "Module", t[t.Property = 9] = "Property", t[t.Event = 10] = "Event", t[t.Operator = 11] = "Operator", t[t.Unit = 12] = "Unit", t[t.Value = 13] = "Value", t[t.Constant = 14] = "Constant", t[t.Enum = 15] = "Enum", t[t.EnumMember = 16] = "EnumMember", t[t.Keyword = 17] = "Keyword", t[t.Text = 18] = "Text", t[t.Color = 19] = "Color", t[t.File = 20] = "File", t[t.Reference = 21] = "Reference", t[t.Customcolor = 22] = "Customcolor", t[t.Folder = 23] = "Folder", t[t.TypeParameter = 24] = "TypeParameter", t[t.User = 25] = "User", t[t.Issue = 26] = "Issue", t[t.Snippet = 27] = "Snippet", t))(L || {}), y = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.KeepWhitespace = 1] = "KeepWhitespace", t[t.InsertAsSnippet = 4] = "InsertAsSnippet", t))(y || {});
3426
- function _e(t) {
3431
+ function Ae(t) {
3427
3432
  switch (t) {
3428
3433
  case m.Schema:
3429
3434
  return L.Module;
@@ -3443,8 +3448,8 @@ function _e(t) {
3443
3448
  return L.Text;
3444
3449
  }
3445
3450
  }
3446
- function Oe(t, e) {
3447
- if (!t || Ve(t))
3451
+ function Re(t, e) {
3452
+ if (!t || Ce(t))
3448
3453
  return !1;
3449
3454
  for (const n of t.trailingTrivia) {
3450
3455
  if (n.start > e)
@@ -3459,7 +3464,7 @@ function O() {
3459
3464
  suggestions: []
3460
3465
  };
3461
3466
  }
3462
- function Re(t) {
3467
+ function De(t) {
3463
3468
  return {
3464
3469
  ...t,
3465
3470
  suggestions: t.suggestions.map((e) => ({
@@ -3468,38 +3473,38 @@ function Re(t) {
3468
3473
  }))
3469
3474
  };
3470
3475
  }
3471
- function Ue(t) {
3476
+ function Fe(t) {
3472
3477
  return {
3473
3478
  ...t,
3474
3479
  suggestions: t.suggestions.map((e) => ({
3475
3480
  ...e,
3476
- insertText: e.insertText.search(/[^a-zA-Z\d_]/) !== -1 || e.insertText[0].match(/\d/) ? `"${e.insertText}"` : e.insertText
3481
+ insertText: e.insertText.split("").every(Ue) ? e.insertText : `"${e.insertText}"`
3477
3482
  }))
3478
3483
  };
3479
3484
  }
3480
- function Ke(t, e) {
3485
+ function et(t, e) {
3481
3486
  return t.getOffsetAt(e);
3482
3487
  }
3483
- class Ft {
3488
+ class Bt {
3484
3489
  constructor(e, n = []) {
3485
3490
  this.compiler = e, this.triggerCharacters = n;
3486
3491
  }
3487
3492
  provideCompletionItems(e, n) {
3488
3493
  var T, f;
3489
- const s = Ke(e, n), i = this.compiler.token.flatStream(), { token: r, index: a } = this.compiler.container.token(s), l = a === void 0 ? i[0] : i[a + 1];
3494
+ const s = et(e, n), i = this.compiler.token.flatStream(), { token: r, index: a } = this.compiler.container.token(s), l = a === void 0 ? i[0] : i[a + 1];
3490
3495
  if ([
3491
3496
  ...(r == null ? void 0 : r.trailingTrivia) || [],
3492
3497
  ...(r == null ? void 0 : r.leadingTrivia) || [],
3493
3498
  ...(l == null ? void 0 : l.leadingTrivia) || []
3494
- ].find((N) => Wt(N) && Le(s, N)))
3499
+ ].find((N) => jt(N) && Le(s, N)))
3495
3500
  return O();
3496
3501
  if (a === void 0)
3497
- return mt();
3502
+ return Tt();
3498
3503
  if ([u.STRING_LITERAL, u.QUOTED_STRING].includes(r.kind) && Le(s, r))
3499
3504
  return O();
3500
3505
  const p = this.compiler.container.element(s);
3501
3506
  if (this.compiler.container.scopeKind(s) === R.TOPLEVEL || p instanceof A && p.type && p.type.start <= s && p.type.end >= s)
3502
- return mt();
3507
+ return Tt();
3503
3508
  const h = [...this.compiler.container.stack(s)].reverse();
3504
3509
  for (const N of h)
3505
3510
  if (N instanceof q)
@@ -3508,7 +3513,7 @@ class Ft {
3508
3513
  case "<":
3509
3514
  case "<>":
3510
3515
  case "-":
3511
- return pt(
3516
+ return dt(
3512
3517
  this.compiler,
3513
3518
  s,
3514
3519
  N
@@ -3520,13 +3525,13 @@ class Ft {
3520
3525
  case "<":
3521
3526
  case "<>":
3522
3527
  case "-":
3523
- return pt(
3528
+ return dt(
3524
3529
  this.compiler,
3525
3530
  s,
3526
3531
  N
3527
3532
  );
3528
3533
  case ".":
3529
- return Bt(
3534
+ return Vt(
3530
3535
  this.compiler,
3531
3536
  s,
3532
3537
  N
@@ -3534,32 +3539,32 @@ class Ft {
3534
3539
  }
3535
3540
  else {
3536
3541
  if (N instanceof se)
3537
- return dt(this.compiler, s, N);
3542
+ return Et(this.compiler, s, N);
3538
3543
  if (N instanceof P)
3539
- return dt(this.compiler, s, N);
3544
+ return Et(this.compiler, s, N);
3540
3545
  if (N instanceof Z)
3541
- return Jn(this.compiler, s);
3546
+ return Zn(this.compiler, s);
3542
3547
  if (N instanceof w)
3543
- return Nt(this.compiler, s, N);
3548
+ return mt(this.compiler, s, N);
3544
3549
  if (N instanceof A && (N.bodyColon && s >= N.bodyColon.end || N.body && Le(s, N.body)))
3545
- return Nt(this.compiler, s, void 0);
3550
+ return mt(this.compiler, s, void 0);
3546
3551
  }
3547
3552
  return O();
3548
3553
  }
3549
3554
  }
3550
- function pt(t, e, n) {
3555
+ function dt(t, e, n) {
3551
3556
  const s = t.container.scopeKind(e);
3552
3557
  if ([R.REF, R.TABLE].includes(s)) {
3553
- const i = Me(t, e, t.container.element(e), [
3558
+ const i = Be(t, e, t.container.element(e), [
3554
3559
  m.Table,
3555
3560
  m.Schema,
3556
3561
  m.Column
3557
3562
  ]);
3558
- return Oe(n.op, e) ? Re(i) : i;
3563
+ return Re(n.op, e) ? De(i) : i;
3559
3564
  }
3560
3565
  return O();
3561
3566
  }
3562
- function Me(t, e, n, s) {
3567
+ function Be(t, e, n, s) {
3563
3568
  var a;
3564
3569
  if (n === void 0)
3565
3570
  return O();
@@ -3573,57 +3578,57 @@ function Me(t, e, n, s) {
3573
3578
  label: p,
3574
3579
  insertText: p,
3575
3580
  insertTextRules: y.KeepWhitespace,
3576
- kind: _e(h),
3577
- sortText: _e(h).toString().padStart(2, "0"),
3581
+ kind: Ae(h),
3582
+ sortText: Ae(h).toString().padStart(2, "0"),
3578
3583
  range: void 0
3579
3584
  }))
3580
3585
  );
3581
3586
  }
3582
3587
  i = i instanceof A ? i.parent : void 0;
3583
3588
  }
3584
- return Ue(r);
3589
+ return Fe(r);
3585
3590
  }
3586
- function Jn(t, e) {
3591
+ function Zn(t, e) {
3587
3592
  var s;
3588
3593
  switch (t.container.scopeKind(e)) {
3589
3594
  case R.INDEXES:
3590
- return Gt(t, e);
3595
+ return Ct(t, e);
3591
3596
  case R.REF:
3592
3597
  {
3593
3598
  const i = [...t.container.stack(e)];
3594
3599
  for (; i.length > 0; ) {
3595
3600
  const r = i.pop();
3596
3601
  if (r instanceof H && ((s = r.op) == null ? void 0 : s.value) === ".")
3597
- return Bt(
3602
+ return Vt(
3598
3603
  t,
3599
3604
  e,
3600
3605
  r
3601
3606
  );
3602
3607
  }
3603
3608
  }
3604
- return Vt(t, e);
3609
+ return Gt(t, e);
3605
3610
  }
3606
3611
  return O();
3607
3612
  }
3608
- function dt(t, e, n) {
3613
+ function Et(t, e, n) {
3609
3614
  const { token: s } = t.container.token(e);
3610
3615
  if ([u.COMMA, u.LBRACKET].includes(s == null ? void 0 : s.kind)) {
3611
- const i = Et(t, e);
3612
- return (s == null ? void 0 : s.kind) === u.COMMA && Oe(s, e) ? Re(i) : i;
3616
+ const i = Nt(t, e);
3617
+ return (s == null ? void 0 : s.kind) === u.COMMA && Re(s, e) ? De(i) : i;
3613
3618
  }
3614
3619
  if (n.name && n.name.start <= e && n.name.end >= e)
3615
- return Et(t, e);
3620
+ return Nt(t, e);
3616
3621
  if (n.name instanceof $) {
3617
- const i = Zn(
3622
+ const i = Kn(
3618
3623
  t,
3619
3624
  e,
3620
3625
  Ne(n.name).unwrap()
3621
3626
  );
3622
- return (s == null ? void 0 : s.kind) === u.COLON && Oe(s, e) ? Re(i) : i;
3627
+ return (s == null ? void 0 : s.kind) === u.COLON && Re(s, e) ? De(i) : i;
3623
3628
  }
3624
3629
  return O();
3625
3630
  }
3626
- function Et(t, e) {
3631
+ function Nt(t, e) {
3627
3632
  const n = t.container.element(e), s = t.container.scopeKind(e);
3628
3633
  if (n instanceof G)
3629
3634
  return O();
@@ -3722,7 +3727,7 @@ function Et(t, e) {
3722
3727
  }
3723
3728
  return O();
3724
3729
  }
3725
- function Zn(t, e, n) {
3730
+ function Kn(t, e, n) {
3726
3731
  switch (n == null ? void 0 : n.toLowerCase()) {
3727
3732
  case "update":
3728
3733
  case "delete":
@@ -3748,42 +3753,42 @@ function Zn(t, e, n) {
3748
3753
  }
3749
3754
  return O();
3750
3755
  }
3751
- function Bt(t, e, n) {
3756
+ function Vt(t, e, n) {
3752
3757
  const s = he(n).unwrap_or([]);
3753
3758
  if (s.pop(), s.some((r) => !M(r)))
3754
3759
  return O();
3755
3760
  const i = s.map((r) => X(r).unwrap());
3756
- return Ue({
3761
+ return Fe({
3757
3762
  suggestions: t.symbol.ofName({ nameStack: i, owner: t.container.element(e) }).flatMap(({ symbol: r }) => t.symbol.members(r)).map(({ kind: r, name: a }) => ({
3758
3763
  label: a,
3759
3764
  insertText: a,
3760
- kind: _e(r),
3765
+ kind: Ae(r),
3761
3766
  range: void 0
3762
3767
  }))
3763
3768
  });
3764
3769
  }
3765
- function Nt(t, e, n) {
3770
+ function mt(t, e, n) {
3766
3771
  var i;
3767
3772
  switch (t.container.scopeKind(e)) {
3768
3773
  case R.TABLE:
3769
- return es(t, e, n);
3770
- case R.PROJECT:
3771
3774
  return ts(t, e, n);
3775
+ case R.PROJECT:
3776
+ return ns(t, e, n);
3772
3777
  case R.INDEXES:
3773
- return ss(t, e);
3778
+ return is(t, e);
3774
3779
  case R.ENUM:
3775
- return Kn(t, e, n);
3780
+ return es(t, e, n);
3776
3781
  case R.REF: {
3777
- const r = Vt(t, e);
3778
- return ((i = t.container.token(e).token) == null ? void 0 : i.kind) === u.COLON && Oe(t.container.token(e).token, e) ? Re(r) : r;
3782
+ const r = Gt(t, e);
3783
+ return ((i = t.container.token(e).token) == null ? void 0 : i.kind) === u.COLON && Re(t.container.token(e).token, e) ? De(r) : r;
3779
3784
  }
3780
3785
  case R.TABLEGROUP:
3781
- return ns(t);
3786
+ return ss(t);
3782
3787
  default:
3783
3788
  return O();
3784
3789
  }
3785
3790
  }
3786
- function mt() {
3791
+ function Tt() {
3787
3792
  return {
3788
3793
  suggestions: ["Table", "TableGroup", "Enum", "Project", "Ref"].map((t) => ({
3789
3794
  label: t,
@@ -3794,14 +3799,14 @@ function mt() {
3794
3799
  }))
3795
3800
  };
3796
3801
  }
3797
- function Kn(t, e, n) {
3798
- return n != null && n.callee && et(e, n) === 1 ? Me(t, e, t.container.element(e), [
3802
+ function es(t, e, n) {
3803
+ return n != null && n.callee && tt(e, n) === 1 ? Be(t, e, t.container.element(e), [
3799
3804
  m.Schema,
3800
3805
  m.Table,
3801
3806
  m.Column
3802
3807
  ]) : O();
3803
3808
  }
3804
- function es(t, e, n) {
3809
+ function ts(t, e, n) {
3805
3810
  if (!(n != null && n.callee))
3806
3811
  return {
3807
3812
  suggestions: ["Note", "indexes"].map((i) => ({
@@ -3812,7 +3817,7 @@ function es(t, e, n) {
3812
3817
  range: void 0
3813
3818
  }))
3814
3819
  };
3815
- const s = et(e, n);
3820
+ const s = tt(e, n);
3816
3821
  return s === 0 ? {
3817
3822
  suggestions: ["Note", "indexes"].map((i) => ({
3818
3823
  label: i,
@@ -3821,10 +3826,10 @@ function es(t, e, n) {
3821
3826
  kind: L.Keyword,
3822
3827
  range: void 0
3823
3828
  }))
3824
- } : s === 1 ? is(t, e) : O();
3829
+ } : s === 1 ? rs(t, e) : O();
3825
3830
  }
3826
- function ts(t, e, n) {
3827
- return n != null && n.callee ? et(e, n) === 0 ? {
3831
+ function ns(t, e, n) {
3832
+ return n != null && n.callee ? tt(e, n) === 0 ? {
3828
3833
  suggestions: ["Table", "TableGroup", "Enum", "Note", "Ref"].map((i) => ({
3829
3834
  label: i,
3830
3835
  insertText: i,
@@ -3842,15 +3847,15 @@ function ts(t, e, n) {
3842
3847
  }))
3843
3848
  };
3844
3849
  }
3845
- function Vt(t, e) {
3846
- return Me(t, e, t.container.element(e), [
3850
+ function Gt(t, e) {
3851
+ return Be(t, e, t.container.element(e), [
3847
3852
  m.Schema,
3848
3853
  m.Table,
3849
3854
  m.Column
3850
3855
  ]);
3851
3856
  }
3852
- function ns(t) {
3853
- return Ue({
3857
+ function ss(t) {
3858
+ return Fe({
3854
3859
  suggestions: [...t.parse.publicSymbolTable().entries()].flatMap(([e]) => {
3855
3860
  const n = ie(e).unwrap_or(void 0);
3856
3861
  if (n === void 0)
@@ -3860,16 +3865,16 @@ function ns(t) {
3860
3865
  label: i,
3861
3866
  insertText: i,
3862
3867
  insertTextRules: y.KeepWhitespace,
3863
- kind: _e(s),
3868
+ kind: Ae(s),
3864
3869
  range: void 0
3865
3870
  };
3866
3871
  })
3867
3872
  });
3868
3873
  }
3869
- function ss(t, e) {
3870
- return Gt(t, e);
3871
- }
3872
3874
  function is(t, e) {
3875
+ return Ct(t, e);
3876
+ }
3877
+ function rs(t, e) {
3873
3878
  return {
3874
3879
  suggestions: [
3875
3880
  ...[
@@ -3937,19 +3942,19 @@ function is(t, e) {
3937
3942
  sortText: L.TypeParameter.toString().padStart(2, "0"),
3938
3943
  range: void 0
3939
3944
  })),
3940
- ...Me(t, e, t.container.element(e), [
3945
+ ...Be(t, e, t.container.element(e), [
3941
3946
  m.Enum,
3942
3947
  m.Schema
3943
3948
  ]).suggestions
3944
3949
  ]
3945
3950
  };
3946
3951
  }
3947
- function Gt(t, e) {
3952
+ function Ct(t, e) {
3948
3953
  const n = t.container.element(e), s = n == null ? void 0 : n.parent;
3949
- if (!((s == null ? void 0 : s.symbol) instanceof _t))
3954
+ if (!((s == null ? void 0 : s.symbol) instanceof At))
3950
3955
  return O();
3951
3956
  const { symbolTable: i } = s.symbol;
3952
- return Ue({
3957
+ return Fe({
3953
3958
  suggestions: [...i.entries()].flatMap(([r]) => {
3954
3959
  const a = ie(r).unwrap_or(void 0);
3955
3960
  if (a === void 0)
@@ -3959,25 +3964,25 @@ function Gt(t, e) {
3959
3964
  label: l,
3960
3965
  insertText: l,
3961
3966
  insertTextRules: y.KeepWhitespace,
3962
- kind: _e(m.Column),
3967
+ kind: Ae(m.Column),
3963
3968
  range: void 0
3964
3969
  };
3965
3970
  })
3966
3971
  });
3967
3972
  }
3968
- function et(t, e) {
3973
+ function tt(t, e) {
3969
3974
  if (!e.callee)
3970
3975
  return -1;
3971
3976
  const n = [e.callee, ...e.args], s = n.findIndex((i) => t <= i.end);
3972
3977
  return s === -1 ? n.length : s;
3973
3978
  }
3974
- class Ct {
3979
+ class Xt {
3975
3980
  constructor(e) {
3976
3981
  this.compiler = e;
3977
3982
  }
3978
3983
  provideDefinition(e, n) {
3979
3984
  var a;
3980
- const { uri: s } = e, i = Ke(e, n), r = [...this.compiler.container.stack(i)];
3985
+ const { uri: s } = e, i = et(e, n), r = [...this.compiler.container.stack(i)];
3981
3986
  for (; r.length !== 0; ) {
3982
3987
  const l = r.pop();
3983
3988
  if ((a = l == null ? void 0 : l.referee) != null && a.declaration && [de.PRIMARY_EXPRESSION, de.VARIABLE].includes(l == null ? void 0 : l.kind)) {
@@ -3998,12 +4003,12 @@ class Ct {
3998
4003
  return [];
3999
4004
  }
4000
4005
  }
4001
- class Xt {
4006
+ class $t {
4002
4007
  constructor(e) {
4003
4008
  this.compiler = e;
4004
4009
  }
4005
4010
  provideReferences(e, n) {
4006
- const { uri: s } = e, i = Ke(e, n), r = [...this.compiler.container.stack(i)];
4011
+ const { uri: s } = e, i = et(e, n), r = [...this.compiler.container.stack(i)];
4007
4012
  for (; r.length !== 0; ) {
4008
4013
  const a = r.pop();
4009
4014
  if (a && [
@@ -4027,24 +4032,24 @@ class Xt {
4027
4032
  return [];
4028
4033
  }
4029
4034
  }
4030
- const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4035
+ const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4031
4036
  __proto__: null,
4032
4037
  CompletionItemInsertTextRule: y,
4033
4038
  CompletionItemKind: L,
4034
- DBMLCompletionItemProvider: Ft,
4035
- DBMLDefinitionProvider: Ct,
4036
- DBMLReferencesProvider: Xt
4039
+ DBMLCompletionItemProvider: Bt,
4040
+ DBMLDefinitionProvider: Xt,
4041
+ DBMLReferencesProvider: $t
4037
4042
  }, Symbol.toStringTag, { value: "Module" }));
4038
4043
  var R = /* @__PURE__ */ ((t) => (t[t.TABLE = 0] = "TABLE", t[t.ENUM = 1] = "ENUM", t[t.TABLEGROUP = 2] = "TABLEGROUP", t[t.INDEXES = 3] = "INDEXES", t[t.NOTE = 4] = "NOTE", t[t.REF = 5] = "REF", t[t.PROJECT = 6] = "PROJECT", t[t.CUSTOM = 7] = "CUSTOM", t[t.TOPLEVEL = 8] = "TOPLEVEL", t))(R || {});
4039
- class ls {
4044
+ class cs {
4040
4045
  constructor() {
4041
4046
  this.source = "", this.cache = new Array(
4042
4047
  16
4043
4048
  /* TOTAL_QUERY_COUNT */
4044
- ).fill(null), this.nodeIdGenerator = new jt(), this.symbolIdGenerator = new Ht(), this.token = {
4049
+ ).fill(null), this.nodeIdGenerator = new Yt(), this.symbolIdGenerator = new Jt(), this.token = {
4045
4050
  invalidStream: this.createQuery(
4046
4051
  6,
4047
- () => this.parse.tokens().filter(At)
4052
+ () => this.parse.tokens().filter(vt)
4048
4053
  ),
4049
4054
  // Valid + Invalid tokens (which are guarenteed to be non-trivials) are included in the stream
4050
4055
  flatStream: this.createQuery(
@@ -4056,8 +4061,8 @@ class ls {
4056
4061
  _: this.createQuery(
4057
4062
  0,
4058
4063
  () => {
4059
- const e = new on(this.source).lex().chain((n) => new un(n, this.nodeIdGenerator).parse()).chain(({ ast: n, tokens: s }) => new Wn(n, this.symbolIdGenerator).analyze().map(() => ({ ast: n, tokens: s })));
4060
- return e.getErrors().length > 0 ? e : e.chain(({ ast: n, tokens: s }) => new qn(n).interpret().map((r) => ({ ast: n, tokens: s, rawDb: r })));
4064
+ const e = new ln(this.source).lex().chain((n) => new hn(n, this.nodeIdGenerator).parse()).chain(({ ast: n, tokens: s }) => new jn(n, this.symbolIdGenerator).analyze().map(() => ({ ast: n, tokens: s })));
4065
+ return e.getErrors().length > 0 ? e : e.chain(({ ast: n, tokens: s }) => new Hn(n).interpret().map((r) => ({ ast: n, tokens: s, rawDb: r })));
4061
4066
  }
4062
4067
  ),
4063
4068
  ast: this.createQuery(
@@ -4094,7 +4099,7 @@ class ls {
4094
4099
  let a = this.parse.ast();
4095
4100
  const l = [a];
4096
4101
  for (; ; ) {
4097
- const h = an(a).find((T) => Le(r, T));
4102
+ const h = on(a).find((T) => Le(r, T));
4098
4103
  if (h === void 0 || h instanceof B)
4099
4104
  break;
4100
4105
  l.push(h), a = h;
@@ -4193,7 +4198,7 @@ class ls {
4193
4198
  let l = [a], p = [];
4194
4199
  for (const h of e)
4195
4200
  p = l.flatMap(
4196
- (T) => Qt(h).flatMap((f) => {
4201
+ (T) => qt(h).flatMap((f) => {
4197
4202
  const N = T.get(f), g = ie(f).unwrap_or(void 0);
4198
4203
  return !N || !g ? [] : { ...g, symbol: N };
4199
4204
  })
@@ -4236,14 +4241,14 @@ class ls {
4236
4241
  }
4237
4242
  initMonacoServices() {
4238
4243
  return {
4239
- definitionProvider: new Ct(this),
4240
- referenceProvider: new Xt(this),
4241
- autocompletionProvider: new Ft(this)
4244
+ definitionProvider: new Xt(this),
4245
+ referenceProvider: new $t(this),
4246
+ autocompletionProvider: new Bt(this)
4242
4247
  };
4243
4248
  }
4244
4249
  }
4245
4250
  export {
4246
- ls as Compiler,
4247
- as as serialize,
4248
- os as services
4251
+ cs as Compiler,
4252
+ os as serialize,
4253
+ ls as services
4249
4254
  };