import { immutable } from '../../decorators';
import { ExpressionNode, LogicNode, LOGIC_TYPE } from '../LogicItem';

/**
 * 循环分支
 * @TODO: 当前类目前主要用于生成文档
 */
export class WhileStatement extends ExpressionNode {
    /**
     * 逻辑节点类型
     */
    @immutable()
    public readonly type: LOGIC_TYPE = LOGIC_TYPE.WhileStatement;
    /**
     * 条件
     */
    @immutable()
    public readonly test: ExpressionNode = undefined;
    /**
     * 循环体
     */
    @immutable()
    public readonly body: Array<LogicNode> = [];
    /**
     * 生成 JS 脚本
     */
    toScript() {
        return '';
    }
}
