calcium-lang
Version:
Calcium language interpreter
22 lines (21 loc) • 739 B
TypeScript
import Command from "./command";
import Environment from "../runtime/environment";
import * as Expr from "../expression";
/**
* `for i in range(start, stop, step):` loop
*/
export default class ForRange implements Command {
readonly varName: string;
readonly start: Expr.Expression | null;
readonly stop: Expr.Expression;
readonly step: Expr.Expression | null;
/**
*
* @param varName a counter variable
* @param start start from the value (default 0)
* @param stop stop to the value
* @param step step by the value (default 1)
*/
constructor(varName: string, start: Expr.Expression | null, stop: Expr.Expression, step: Expr.Expression | null);
execute(env: Environment): void;
}