calcium-lang
Version:
Calcium language interpreter
21 lines (20 loc) • 695 B
TypeScript
import { Expression, Reference } from ".";
import Environment from "../runtime/environment";
import { InternalType } from "../type";
/**
* access the element by an index or a key
*/
export default class Subscript {
readonly referredObj: Reference;
readonly lower: Expression;
readonly upper?: Expression | undefined;
/**
*
* @param referredObj
* @param lower could be a single index or key. Otherwise the value from which
* a slice starts.
* @param upper the value at which a slice ends, if any
*/
constructor(referredObj: Reference, lower: Expression, upper?: Expression | undefined);
assign(rhs: InternalType, env: Environment): void;
}