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

110 lines 3.05 kB
/** * @import { Site } from "@helios-lang/compiler-utils" * @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI * @typedef {import("../typecheck/index.js").EvalEntity} EvalEntity * @typedef {import("../typecheck/index.js").Func} Func * @typedef {import("../typecheck/index.js").Type} Type * @typedef {import("../typecheck/index.js").Typed} Typed */ /** * ...(...) expression */ export class CallExpr extends Expr { /** * @param {Site} site * @param {Expr} fnExpr * @param {CallArgExpr[]} argExprs */ constructor(site: Site, fnExpr: Expr, argExprs: CallArgExpr[]); /** * @private * @readonly * @type {Expr} */ private readonly _fnExpr; /** * @private * @readonly * @type {CallArgExpr[]} */ private readonly _argExprs; /** * @private * @type {Type[]} */ private _paramTypes; /** * @private * @type {Func | undefined} */ private _appliedFnVal; /** * @private * @type {Typed[]} */ private posArgVals; /** * @private * @type {Record<string, Typed>} */ private namedArgVals; /** * @private * @type {Typed[]} */ private castedPosArgVals; /** * @private * @type {Record<string, Typed>} */ private castedNamedArgVals; get fnExpr(): Expr; /** * Don't call this inside eval() because param types won't yet be complete. * @type {FuncType} */ get fn(): FuncType; /** * @private * @param {Type} argType * @param {Type} targetType * @param {SourceMappedStringI} argIR * @param {ToIRContext} ctx * @returns {SourceMappedStringI} */ private injectCastIR; /** * @private * @param {number | Expr} e * @param {ToIRContext} ctx * @returns {SourceMappedStringI} */ private argExprToIR; /** * @param {ToIRContext} ctx * @returns {[Expr[], SourceMappedStringI[]]} - first list are positional args, second list named args and remaining opt args */ expandArgs(ctx: ToIRContext): [Expr[], SourceMappedStringI[]]; /** * @param {ToIRContext} ctx * @returns {SourceMappedStringI} */ toFnExprIR(ctx: ToIRContext): SourceMappedStringI; /** * @private * @param {Expr[]} posExprs * @returns {Map<Expr, number>} */ private detectExpandedTuples; } export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI; export type EvalEntity = import("../typecheck/index.js").EvalEntity; export type Func = import("../typecheck/index.js").Func; export type Type = import("../typecheck/index.js").Type; export type Typed = import("../typecheck/index.js").Typed; import { Expr } from "./Expr.js"; import { FuncType } from "../typecheck/index.js"; import { ToIRContext } from "../codegen/index.js"; import type { Site } from "@helios-lang/compiler-utils"; import { CallArgExpr } from "./CallArgExpr.js"; //# sourceMappingURL=CallExpr.d.ts.map