bds.js
Version:
A simple interpreter written to simulate and run BDScript Language in JavaScript
31 lines (30 loc) • 732 B
TypeScript
import { Context } from "./Context";
declare type EnvFunction = (ctx: Context) => any;
declare class Environment {
private parent?;
private cache;
private constant;
constructor(parent?: Environment);
set(name: string, value: EnvFunction): any;
const(): void;
/**
* Returns value by key from cache
* @param name
* @returns
*/
get(name: string): any;
private _get;
/**
* Remove value by key from cache
* @param name
* @returns
*/
remove(name: string): boolean;
/**
* Recursively get from Environment to Environment
* @param name
* @returns
*/
private _recursiveGet;
}
export { Environment };