Skip to content

Commit 570a85c

Browse files
committed
feat(core): integrate native SSP archive support and ModelicaSspEntity instantiation
1 parent a23abc7 commit 570a85c

3 files changed

Lines changed: 648 additions & 0 deletions

File tree

packages/core/src/compiler/modelica/model.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,21 @@ export class ModelicaEntity extends ModelicaClassInstance {
17831783
}
17841784
continue;
17851785
}
1786+
// Check for SSP archives
1787+
if (ext === ".ssp") {
1788+
const sspPath = context.fs.join(this.path, dirent.name);
1789+
try {
1790+
// Lazy import to avoid circular dependency
1791+
// eslint-disable-next-line @typescript-eslint/no-require-imports
1792+
const { ModelicaSspEntity } = require("./ssp-archive.js") as typeof import("./ssp-archive.js");
1793+
const sspEntity = new ModelicaSspEntity(this, sspPath);
1794+
sspEntity.name = dirent.name.replace(/\.ssp$/, "");
1795+
this.subEntities.push(sspEntity as unknown as ModelicaEntity);
1796+
} catch {
1797+
// Skip unreadable SSP files
1798+
}
1799+
continue;
1800+
}
17861801
if (ext !== ".mo") continue;
17871802
}
17881803
const subEntity = new ModelicaEntity(this, context.fs.join(this.path, dirent.name));

0 commit comments

Comments
 (0)