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

109 lines 3.41 kB
/** * @import { Site, Word } from "@helios-lang/compiler-utils" * @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI * @typedef {import("../codegen/index.js").Definitions} Definitions * @typedef {import("../typecheck/index.js").EvalEntity} EvalEntity * @typedef {import("../typecheck/index.js").Type} Type */ /** * Function statement * (basically just a named FuncLiteralExpr) * @internal */ export class FuncStatement extends Statement { /** * @param {Statement} s * @returns {boolean} */ static isMethod(s: Statement): boolean; /** * @param {Site} site * @param {Word} name * @param {TypeParameters} parameters * @param {FuncLiteralExpr} funcExpr */ constructor(site: Site, name: Word, parameters: TypeParameters, funcExpr: FuncLiteralExpr); /** * @private * @readonly * @type {TypeParameters} */ private readonly _parameters; /** * @private * @readonly * @type {FuncLiteralExpr} */ private readonly _funcExpr; /** * @type {TypeParameters} */ get typeParameters(): TypeParameters; /** * @type {number} */ get nArgs(): number; /** * @type {FuncArg[]} */ get args(): FuncArg[]; /** * @type {string[]} */ get argNames(): string[]; /** * @type {Type[]} */ get argTypes(): import("../typecheck/common.js").Type[]; /** * @type {string[]} */ get argTypeNames(): string[]; /** * @type {FuncLiteralExpr} */ get funcExpr(): FuncLiteralExpr; /** * @type {Type} */ get retType(): import("../typecheck/common.js").Type; /** * @type {Site} */ get retSite(): Site; /** * Evaluates a function and returns a func value * @param {Scope} scope * @param {boolean} isMember functions that are members of structs or enums aren't added to their own internal scope as they are always accessed through member access * @returns {EvalEntity} */ evalInternal(scope: Scope, isMember?: boolean): EvalEntity; /** * Evaluates type of a funtion. * Separate from evalInternal so we can use this function recursively inside evalInternal * @param {Scope} scope * @returns {ParametricFunc | FuncType} */ evalType(scope: Scope): ParametricFunc | FuncType; /** * Returns IR of function * @param {ToIRContext} ctx * @returns {SourceMappedStringI} */ toIRInternal(ctx: ToIRContext): SourceMappedStringI; } export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI; export type Definitions = import("../codegen/index.js").Definitions; export type EvalEntity = import("../typecheck/index.js").EvalEntity; export type Type = import("../typecheck/index.js").Type; import { Statement } from "./Statement.js"; import { TypeParameters } from "./TypeParameters.js"; import { FuncArg } from "../expressions/index.js"; import { FuncLiteralExpr } from "../expressions/index.js"; import type { Site } from "@helios-lang/compiler-utils"; import { Scope } from "../scopes/index.js"; import { ParametricFunc } from "../typecheck/index.js"; import { FuncType } from "../typecheck/index.js"; import { ToIRContext } from "../codegen/index.js"; import type { Word } from "@helios-lang/compiler-utils"; //# sourceMappingURL=FuncStatement.d.ts.map