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

102 lines 2.95 kB
/** * @import { Site, Token } from "@helios-lang/compiler-utils" * @typedef {import("@helios-lang/ir").SourceMappedStringI} SourceMappedStringI * @typedef {import("../typecheck/index.js").DataType} DataType * @typedef {import("../typecheck/index.js").EvalEntity} EvalEntity * @typedef {import("../typecheck/index.js").Type} Type * @typedef {import("../typecheck/index.js").Typed} Typed */ /** * @typedef {{ * site: Site * cache: EvalEntity | undefined * evalInternal(scope: Scope): EvalEntity * eval(scope: Scope): EvalEntity * evalAsDataType(scope: Scope): DataType * evalAsType(scope: Scope): Type * evalAsTyped(scope: Scope): Typed * isLiteral(): boolean * toIR(ctx: ToIRContext): SourceMappedStringI * toString(): string * }} ExprI */ /** * Base class of every Type and Instance expression. * @implements {ExprI} */ export class Expr implements ExprI { /** * @param {Site} site */ constructor(site: Site); /** * @readonly * @type {Site} */ readonly site: Site; /** * Written in switch cases where initial typeExpr is used as memberName instead * @readwrite * @type {EvalEntity | undefined} */ cache: EvalEntity | undefined; /** * @param {Scope} _scope * @returns {EvalEntity} */ evalInternal(_scope: Scope): EvalEntity; /** * @param {Scope} scope * @returns {EvalEntity} */ eval(scope: Scope): EvalEntity; /** * @param {Scope} scope * @returns {DataType} */ evalAsDataType(scope: Scope): DataType; /** * @param {Scope} scope * @returns {Type} */ evalAsType(scope: Scope): Type; /** * @param {Scope} scope * @returns {Typed} */ evalAsTyped(scope: Scope): Typed; /** * @returns {boolean} */ isLiteral(): boolean; /** * @param {ToIRContext} ctx * @returns {SourceMappedStringI} */ toIR(ctx: ToIRContext): SourceMappedStringI; /** * @returns {string} */ toString(): string; } export type SourceMappedStringI = import("@helios-lang/ir").SourceMappedStringI; export type DataType = import("../typecheck/index.js").DataType; export type EvalEntity = import("../typecheck/index.js").EvalEntity; export type Type = import("../typecheck/index.js").Type; export type Typed = import("../typecheck/index.js").Typed; export type ExprI = { site: Site; cache: EvalEntity | undefined; evalInternal(scope: Scope): EvalEntity; eval(scope: Scope): EvalEntity; evalAsDataType(scope: Scope): DataType; evalAsType(scope: Scope): Type; evalAsTyped(scope: Scope): Typed; isLiteral(): boolean; toIR(ctx: ToIRContext): SourceMappedStringI; toString(): string; }; import type { Site } from "@helios-lang/compiler-utils"; import { Scope } from "../scopes/index.js"; import { ToIRContext } from "../codegen/index.js"; //# sourceMappingURL=Expr.d.ts.map