@dbml/parse 8.0.0-alpha.14 → 8.0.0-alpha.15

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.
@@ -2750,8 +2750,7 @@ function alternateLists(r, j) {
2750
2750
  return M.push(...r.slice(N), ...j.slice(N)), M;
2751
2751
  }
2752
2752
  function shouldInterpretNode(r, j) {
2753
- let M = [...r.parseProject().values()].some((r) => r.getErrors().length > 0), N = r.validateNode(j).getErrors().length > 0, P = r.bindNode(j).getErrors().length > 0;
2754
- return !M && !N && !P;
2753
+ return r.reachableFiles(j.filepath).every((j) => r.bindFile(j).getErrors().length === 0);
2755
2754
  }
2756
2755
  function scanNonListNodeForBinding(r) {
2757
2756
  if (!r) return [];
@@ -7589,7 +7588,13 @@ const programModule$1 = {
7589
7588
  return isProgramNode(N) ? new Binder(N, j).resolve() : Report.create(PASS_THROUGH);
7590
7589
  },
7591
7590
  interpretSymbol(j, N, P) {
7592
- return N instanceof ProgramSymbol ? N.declaration instanceof ProgramNode ? shouldInterpretNode(j, N.declaration) ? new ProgramInterpreter(j, N, P).interpret() : Report.create(void 0, [...j.validateNode(N.declaration).getErrors(), ...j.bindNode(N.declaration).getErrors()]) : Report.create(void 0) : Report.create(PASS_THROUGH);
7591
+ if (!(N instanceof ProgramSymbol)) return Report.create(PASS_THROUGH);
7592
+ if (!(N.declaration instanceof ProgramNode)) return Report.create(void 0);
7593
+ if (!shouldInterpretNode(j, N.declaration)) {
7594
+ let r = j.reachableFiles(P).flatMap((r) => j.bindFile(r).getErrors());
7595
+ return Report.create(void 0, r);
7596
+ }
7597
+ return new ProgramInterpreter(j, N, P).interpret();
7593
7598
  }
7594
7599
  };
7595
7600
  var ProjectBinder = class {
@@ -13380,17 +13385,8 @@ function bindProject() {
13380
13385
  return j;
13381
13386
  }
13382
13387
  function interpretFile(r) {
13383
- let N = [], P = [];
13384
- for (let j of this.reachableFiles(r)) {
13385
- let r = this.parseFile(j);
13386
- N.push(...r.getErrors()), P.push(...r.getWarnings());
13387
- }
13388
- let F = this.bindFile(r);
13389
- if (N.push(...F.getErrors()), P.push(...F.getWarnings()), N.length > 0) return new Report(void 0, N, P);
13390
- let { ast: I } = this.parseFile(r).getValue(), L = this.nodeSymbol(I).getFiltered(UNHANDLED);
13391
- if (!L) return new Report(void 0, N, P);
13392
- let R = this.interpretSymbol(L, r).map((r) => r === UNHANDLED || !r ? void 0 : r);
13393
- return N.push(...R.getErrors()), P.push(...R.getWarnings()), new Report(R.getValue(), N, P);
13388
+ let { ast: N } = this.parseFile(r).getValue(), P = this.nodeSymbol(N).getFiltered(UNHANDLED);
13389
+ return P ? this.interpretSymbol(P, r).map((r) => r === UNHANDLED || !r ? void 0 : r) : Report.create(void 0);
13394
13390
  }
13395
13391
  function interpretProject() {
13396
13392
  let r = [], N = [], P = /* @__PURE__ */ new Set(), F = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/parse",
4
- "version": "8.0.0-alpha.14",
4
+ "version": "8.0.0-alpha.15",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -46,5 +46,5 @@
46
46
  "engines": {
47
47
  "node": ">=18"
48
48
  },
49
- "gitHead": "4f1c1fe17ac6e0e28038b0c5e28db69a9fae365e"
49
+ "gitHead": "a28fb18cf7ea979a81ef65774ef5271f285766d2"
50
50
  }