diff --git a/src/index.ts b/src/index.ts index 7469a0101..da47c4368 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ export { enableFeatures, build } from "./pipeline/build"; +export { precompile } from "./pipeline/precompile"; export { TactError, TactParseError, diff --git a/src/pipeline/precompile.ts b/src/pipeline/precompile.ts index eca8f3533..8ada419da 100644 --- a/src/pipeline/precompile.ts +++ b/src/pipeline/precompile.ts @@ -7,18 +7,20 @@ import { resolveErrors } from "../types/resolveErrors"; import { resolveSignatures } from "../types/resolveSignatures"; import { resolveImports } from "../imports/resolveImports"; import { VirtualFileSystem } from "../vfs/VirtualFileSystem"; +import { AstModule } from "../grammar/ast"; export function precompile( ctx: CompilerContext, project: VirtualFileSystem, stdlib: VirtualFileSystem, entrypoint: string, + parsedModules?: AstModule[], ) { // Load all sources const imported = resolveImports({ entrypoint, project, stdlib }); // Add information about all the source code entries to the context - ctx = openContext(ctx, imported.tact, imported.func); + ctx = openContext(ctx, imported.tact, imported.func, parsedModules); // First load type descriptors and check that // they all have valid signatures