@dbml/parse 8.0.0-alpha.6 → 8.0.0-alpha.8

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) {
@@ -8201,9 +8205,9 @@ const useUtils = { visibleName(r, M) {
8201
8205
  nodeSymbol(N, P) {
8202
8206
  if (!isUseSpecifier(P) || !P.name) return Report.create(PASS_THROUGH);
8203
8207
  let F = P.getSymbolKind();
8204
- if (F === void 0) return Report.create(PASS_THROUGH);
8208
+ if (F === void 0 || F === SymbolKind.Schema) return Report.create(PASS_THROUGH);
8205
8209
  let I = N.nodeReferee(P.name).getFiltered(UNHANDLED);
8206
- return I && !I.canBeImported && F !== SymbolKind.Schema ? Report.create(PASS_THROUGH) : Report.create(N.symbolFactory.create(UseSymbol, {
8210
+ return I && !I.canBeImported ? Report.create(PASS_THROUGH) : Report.create(N.symbolFactory.create(UseSymbol, {
8207
8211
  useSpecifierDeclaration: P,
8208
8212
  declaration: I?.declaration,
8209
8213
  usedSymbol: I,
@@ -9446,12 +9450,14 @@ const schemaModule = { symbolMembers(N, P) {
9446
9450
  for (let j of r) B.push(...expandTableGroup(N, P, j));
9447
9451
  }
9448
9452
  let V = /* @__PURE__ */ new Set(), H = B.filter((r) => {
9453
+ if (r instanceof UseSymbol && r.isKind(SymbolKind.Schema)) return !1;
9449
9454
  let j = `${r.originalSymbol.intern()}:${r.name ?? ""}`;
9450
9455
  return V.has(j) ? !1 : (V.add(j), !0);
9451
9456
  }), U = /* @__PURE__ */ new Map();
9452
9457
  for (let r of H) {
9453
9458
  let j = `${r.kind}:${r.name}`;
9454
9459
  if (U.get(j)) {
9460
+ if (r.isKind(SymbolKind.Schema)) continue;
9455
9461
  let j = r instanceof UseSymbol ? r.useSpecifierDeclaration ?? r.declaration : r.declaration instanceof ElementDeclarationNode && r.declaration.name ? r.declaration.name : r.declaration;
9456
9462
  j && r.name !== void 0 && z.push(getDuplicateSchemaMemberError(r.kind, r.name, F.join("."), j));
9457
9463
  } else U.set(j, r);
@@ -13292,7 +13298,7 @@ function containerScopeKind(r, j) {
13292
13298
  }
13293
13299
  function canonicalName(r, j) {
13294
13300
  let N = j.originalSymbol;
13295
- if (N.filepath.intern() === r.intern()) return Report.create(fullnameToCanonical(this, N));
13301
+ if (N.filepath.equals(r)) return Report.create(fullnameToCanonical(this, N));
13296
13302
  let P = [...this.symbolUses(N).getValue(), ...this.symbolAliases(N).getValue()].filter((j) => j.filepath.equals(r));
13297
13303
  for (let r of P) {
13298
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.6",
4
+ "version": "8.0.0-alpha.8",
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": "52721b96504df2eeb4ff7fc13292896221a837ef"
48
+ "gitHead": "ddb14ef16808f03119bcdc7e28dc88e254a4e21f"
49
49
  }