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

65 lines 1.96 kB
/** * @import { ErrorCollector, GenericGroup, Site, StringLiteral, TokenReader } from "@helios-lang/compiler-utils" */ /** * @typedef {(path: StringLiteral) => (string | undefined)} ImportPathTranslator */ /** * @typedef {{ * currentSite?: Site * importPathTranslator?: ImportPathTranslator | undefined * }} ParseContextOptions */ export class ParseContext { /** * @param {TokenReader} reader * @param {ParseContextOptions} options */ constructor(reader: TokenReader, options?: ParseContextOptions); /** * @readonly * @type {TokenReader} */ readonly reader: TokenReader; /** * @readonly * @type {Site} */ readonly currentSite: Site; /** * @readonly * @type {ImportPathTranslator | undefined} */ readonly importPathTranslator: ImportPathTranslator | undefined; /** * @type {ErrorCollector} */ get errors(): ErrorCollector; /** * @param {Site} site * @returns {ParseContext} */ atSite(site: Site): ParseContext; /** * @param {GenericGroup<TokenReader>} group * @param {number} fieldIndex * @returns {ParseContext} */ inGroup(group: GenericGroup<TokenReader>, fieldIndex?: number): ParseContext; /** * @param {TokenReader} r * @returns {ParseContext} */ withReader(r: TokenReader): ParseContext; } export type ImportPathTranslator = (path: StringLiteral) => (string | undefined); export type ParseContextOptions = { currentSite?: Site; importPathTranslator?: ImportPathTranslator | undefined; }; import type { TokenReader } from "@helios-lang/compiler-utils"; import type { Site } from "@helios-lang/compiler-utils"; import type { ErrorCollector } from "@helios-lang/compiler-utils"; import type { GenericGroup } from "@helios-lang/compiler-utils"; import type { StringLiteral } from "@helios-lang/compiler-utils"; //# sourceMappingURL=ParseContext.d.ts.map