UNPKG

calcium-lang

Version:
46 lines (45 loc) 1.08 kB
/** * Represent the point of the execution or function's address. */ export default class Address { indent: number; line: number; file: number; call: number; /** * */ /** * * @param indent corresponds to Python's indent * @param line line number (index in the code array) * @param file module index * @param call call counter for a recursive function */ constructor(indent: number, line: number, file?: number, call?: number); /** * Make a copy */ clone(): Address; /** * * @param address another address * @returns whether two addresses are at same position */ isAt(address: Address): boolean; /** * jump and go to the specified address * @param toPoint */ jump(toPoint: Address): void; /** * add the delta to the indent * @param x the delta of the indent */ shift(x: number): void; /** * add the delta to the line number * @param y the delta of the line number */ skip(y: number): void; }