import { immutable } from '../../decorators'; import { Identifier } from '../expressions/Identifier'; import { ExpressionNode, LogicNode, LOGIC_TYPE } from '../LogicItem'; import { SwitchCase } from './SwitchCase'; /** * 循环分支 * @TODO: 当前类目前主要用于生成文档 */ export class ForEachStatement extends ExpressionNode { /** * 逻辑节点类型 */ @immutable() public readonly type: LOGIC_TYPE = LOGIC_TYPE.ForEachStatement; /** * 循环列表 */ @immutable() public readonly each: ExpressionNode = undefined; /** * 循环项名称 */ @immutable() public readonly item: Identifier = undefined; /** * 循环项索引 */ @immutable() public readonly index: Identifier = undefined; /** * 起始值 */ @immutable() public readonly start: ExpressionNode = undefined; /** * 结束值 */ @immutable() public readonly end: ExpressionNode = undefined; /** * 循环体 */ @immutable() public readonly body: Array = []; /** * 生成 JS 脚本 */ toScript() { return ''; } }