js-slang
Version:
Javascript-based implementations of Source, written in Typescript
43 lines (42 loc) • 2.38 kB
TypeScript
import { Comment, SourceLocation, VariableDeclaration, VariableDeclarator } from 'estree';
import { StepperBaseNode } from '../../interface';
import { StepperExpression, StepperPattern, undefinedNode } from '..';
export declare class StepperVariableDeclarator implements VariableDeclarator, StepperBaseNode {
type: 'VariableDeclarator';
id: StepperPattern;
init?: StepperExpression | null | undefined;
leadingComments?: Comment[] | undefined;
trailingComments?: Comment[] | undefined;
loc?: SourceLocation | null | undefined;
range?: [number, number] | undefined;
constructor(id: StepperPattern, init: StepperExpression | null | undefined, leadingComments?: Comment[] | undefined, trailingComments?: Comment[] | undefined, loc?: SourceLocation | null | undefined, range?: [number, number] | undefined);
static create(node: VariableDeclarator): StepperVariableDeclarator;
isContractible(): boolean;
isOneStepPossible(): boolean;
contract(): StepperVariableDeclarator;
oneStep(): StepperVariableDeclarator;
substitute(id: StepperPattern, value: StepperExpression): StepperBaseNode;
freeNames(): string[];
allNames(): string[];
rename(before: string, after: string): StepperVariableDeclarator;
}
export declare class StepperVariableDeclaration implements VariableDeclaration, StepperBaseNode {
type: 'VariableDeclaration';
declarations: StepperVariableDeclarator[];
kind: 'var' | 'let' | 'const';
leadingComments?: Comment[] | undefined;
trailingComments?: Comment[] | undefined;
loc?: SourceLocation | null | undefined;
range?: [number, number] | undefined;
constructor(declarations: StepperVariableDeclarator[], kind: 'var' | 'let' | 'const', leadingComments?: Comment[] | undefined, trailingComments?: Comment[] | undefined, loc?: SourceLocation | null | undefined, range?: [number, number] | undefined);
static create(node: VariableDeclaration): StepperVariableDeclaration;
isContractible(): boolean;
isOneStepPossible(): boolean;
contract(): typeof undefinedNode;
contractEmpty(): void;
oneStep(): StepperVariableDeclaration | typeof undefinedNode;
substitute(id: StepperPattern, value: StepperExpression): StepperBaseNode;
freeNames(): string[];
allNames(): string[];
rename(before: string, after: string): StepperVariableDeclaration;
}