@dbml/parse 8.0.0-alpha.7 → 8.0.0-alpha.9

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.
@@ -7350,11 +7350,15 @@ var ProgramInterpreter = class {
7350
7350
  let P = N.getValue();
7351
7351
  P && this.pushElement(M, P);
7352
7352
  }
7353
- let r = this.compiler.symbolMembers(this.programSymbol).getFiltered(UNHANDLED) ?? [];
7354
- for (let M of r) {
7355
- if (!(M instanceof SchemaSymbol)) continue;
7356
- let r = this.compiler.symbolMembers(M).getFiltered(UNHANDLED) ?? [];
7357
- for (let j of r) j instanceof UseSymbol && this.interpretUseSymbol(j);
7353
+ let r = /* @__PURE__ */ new Set(), M = this.compiler.symbolMembers(this.programSymbol).getFiltered(UNHANDLED) ?? [];
7354
+ for (let N of M) {
7355
+ if (!(N instanceof SchemaSymbol)) continue;
7356
+ let M = this.compiler.symbolMembers(N).getFiltered(UNHANDLED) ?? [];
7357
+ for (let j of M) {
7358
+ if (!(j instanceof UseSymbol)) continue;
7359
+ let M = j.originalSymbol.intern();
7360
+ r.has(M) || (r.add(M), this.interpretUseSymbol(j));
7361
+ }
7358
7362
  }
7359
7363
  }
7360
7364
  interpretUseSymbol(r) {
@@ -8227,7 +8231,7 @@ const useUtils = { visibleName(r, M) {
8227
8231
  let z = P.parentOfKind(UseDeclarationNode);
8228
8232
  if (z?.importPath?.value === void 0) return Report.create(void 0);
8229
8233
  let B = resolveImportFilepath(P.filepath, z.importPath.value);
8230
- if (!B) return Report.create(void 0);
8234
+ if (!B) return Report.create(void 0, [new CompileError(CompileErrorCode.BINDING_ERROR, `Import path must be relative, got '${z.importPath.value}'`, P)]);
8231
8235
  if (!N.layout.exists(B)) return Report.create(void 0, [new CompileError(CompileErrorCode.NONEXISTENT_MODULE, `${I} '${L?.join(".") ?? R}' does not exist in file ${B.toString()}. Does the file exist?`, P)]);
8232
8236
  let V = P.parentOfKind(InfixExpressionNode)?.leftExpression;
8233
8237
  if (V && V !== P) {
@@ -8244,7 +8248,7 @@ const useUtils = { visibleName(r, M) {
8244
8248
  let r = [];
8245
8249
  if (N.importPath?.value) {
8246
8250
  let M = resolveImportFilepath(N.filepath, N.importPath.value);
8247
- M && !j.layout.exists(M) && r.push(new CompileError(CompileErrorCode.NONEXISTENT_MODULE, `Failed to resolve the non-existent file '${N.importPath.value}'`, N.importPath));
8251
+ M ? j.layout.exists(M) || r.push(new CompileError(CompileErrorCode.NONEXISTENT_MODULE, `Failed to resolve the non-existent file '${N.importPath.value}'`, N.importPath)) : r.push(new CompileError(CompileErrorCode.BINDING_ERROR, `Import path must be relative, got '${N.importPath.value}'`, N.importPath));
8248
8252
  }
8249
8253
  if (N.specifiers) {
8250
8254
  let M = j.bindNode(N.specifiers);
@@ -13294,7 +13298,7 @@ function containerScopeKind(r, j) {
13294
13298
  }
13295
13299
  function canonicalName(r, j) {
13296
13300
  let N = j.originalSymbol;
13297
- if (N.filepath.intern() === r.intern()) return Report.create(fullnameToCanonical(this, N));
13301
+ if (N.filepath.equals(r)) return Report.create(fullnameToCanonical(this, N));
13298
13302
  let P = [...this.symbolUses(N).getValue(), ...this.symbolAliases(N).getValue()].filter((j) => j.filepath.equals(r));
13299
13303
  for (let r of P) {
13300
13304
  let j = r.name;
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.7",
4
+ "version": "8.0.0-alpha.9",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=18"
47
47
  },
48
- "gitHead": "4c4389c0126b09613bc4daec1c4b938dddb3c434"
48
+ "gitHead": "b5a159cdd4e2f0d53da79447ffacd79ce4872df5"
49
49
  }