UNPKG

@helios-lang/compiler

Version:

Helios is a Domain Specific Language that compiles to Plutus-Core (i.e. Cardano on-chain validator scripts). Helios is a non-Haskell alternative to Plutus. With this library you can compile Helios scripts and build Cardano transactions, all you need to bu

82 lines 2.78 kB
/** * @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI * @typedef {import("../codegen/index.js").Definitions} Definitions */ export class ModuleCollection { /** * @param {Module[]} modules */ constructor(modules: Module[]); /** * @readonly * @type {Module[]} */ readonly modules: Module[]; /** * @type {[Statement, boolean][]} - boolean value marks if statement is import or not */ get allStatements(): [Statement, boolean][]; /** * @type {Module} */ get lastModule(): Module; /** * @type {MainModule} */ get mainModule(): MainModule; /** * @type {Module[]} */ get nonMainModules(): Module[]; /** * @private * @param {SourceMappedStringI} ir * @param {Definitions} definitions * @returns {Definitions} */ private eliminateUnused; /** * @param {TopScope} topScope */ evalTypes(topScope: TopScope): void; /** * Loops over all statements, until endCond == true (includes the matches statement) * Then applies type parameters * @param {ToIRContext} ctx * @param {SourceMappedStringI} ir * @param {(s: Statement, isImport: boolean) => boolean} endCond * @param {Definitions | undefined} extra * @returns {Definitions} */ fetchDefinitions(ctx: ToIRContext, ir: SourceMappedStringI, endCond: (s: Statement, isImport: boolean) => boolean, extra?: Definitions | undefined): Definitions; /** * @param {(name: string, statement: ConstStatement) => void} callback */ loopConstStatements(callback: (name: string, statement: ConstStatement) => void): void; /** * @param {ToIRContext} ctx * @param {(s: Statement, isImport: boolean) => boolean} endCond * @returns {Definitions} */ statementsToIR(ctx: ToIRContext, endCond: (s: Statement, isImport: boolean) => boolean): Definitions; /** * @returns {string} */ toString(): string; /** * @param {ToIRContext} ctx * @param {SourceMappedStringI} ir * @param {Definitions} definitions * @returns {SourceMappedStringI} */ wrap(ctx: ToIRContext, ir: SourceMappedStringI, definitions: Definitions): SourceMappedStringI; } export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI; export type Definitions = import("../codegen/index.js").Definitions; import { Module } from "./Module.js"; import { Statement } from "../statements/index.js"; import { MainModule } from "./MainModule.js"; import { TopScope } from "../scopes/index.js"; import { ToIRContext } from "../codegen/index.js"; import { ConstStatement } from "../statements/index.js"; //# sourceMappingURL=ModuleCollection.d.ts.map