示例#1
0
        public override SucoExpression Optimize(SucoEnvironment env, int?[] givens)
        {
            var valueExpr = ValueExpression.Optimize(env, givens);
            var innerExpr = InnerExpression.Optimize(env.DeclareVariable(VariableName, valueExpr is SucoConstant c ? c.Value : null), givens);

            return(innerExpr is SucoConstant ? innerExpr : new SucoLetExpression(StartIndex, EndIndex, VariableName, valueExpr, innerExpr, Type));
        }