UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

35 lines (34 loc) 1.68 kB
/** * This class represents a literal node in the stepper's AST (Abstract Syntax Tree). * It extends both SimpleLiteral and StepperBaseNode to integrate with the stepper system. * The class stores value-related properties such as type, value, raw representation, * and location metadata. * * Methods: * - isContractible(): Indicates whether this node can be contracted (returns false). * - isOneStepPossible(): Indicates whether a single step evaluation is possible (returns false). * - contract(): Throws an error as contraction is not implemented. * - oneStep(): Throws an error as one-step evaluation is not implemented. */ import { Comment, SimpleLiteral, SourceLocation } from 'estree'; import { StepperBaseNode } from '../../interface'; import { StepperExpression, StepperPattern } from '..'; export declare class StepperLiteral implements SimpleLiteral, StepperBaseNode { type: 'Literal'; value: string | number | boolean | null; raw?: string; leadingComments?: Comment[]; trailingComments?: Comment[]; loc?: SourceLocation | null; range?: [number, number]; constructor(value: string | number | boolean | null, raw?: string, leadingComments?: Comment[], trailingComments?: Comment[], loc?: SourceLocation | null, range?: [number, number]); static create(literal: SimpleLiteral): StepperLiteral; isContractible(): boolean; isOneStepPossible(): boolean; contract(): StepperLiteral; oneStep(): StepperLiteral; substitute(_id: StepperPattern, _value: StepperExpression): StepperLiteral; freeNames(): string[]; allNames(): string[]; rename(_before: string, _after: string): StepperExpression; }