public bool VisitExprCase(ExprCase expr, TCtx arg) { var res = this.Visit(expr, "Case", arg, out var argOut) && this.Accept("Cases", expr.Cases, argOut) && this.Accept("DefaultValue", expr.DefaultValue, argOut); this._visitor.EndVisitExpr(expr, arg); return(res); }
public bool VisitExprCase(ExprCase exprCase, IExpr?parent) { this.AssertNotEmptyList(exprCase.Cases, "Cases cannot be empty"); this.Builder.Append("CASE"); for (int i = 0; i < exprCase.Cases.Count; i++) { this.Builder.Append(' '); exprCase.Cases[i].Accept(this, exprCase); } this.Builder.Append(" ELSE "); exprCase.DefaultValue.Accept(this, exprCase); this.Builder.Append(" END"); return(true); }
public static ExprCase WithDefaultValue(this ExprCase original, ExprValue newDefaultValue) => new ExprCase(cases: original.Cases, defaultValue: newDefaultValue);
public static ExprCase WithCases(this ExprCase original, IReadOnlyList <ExprCaseWhenThen> newCases) => new ExprCase(cases: newCases, defaultValue: original.DefaultValue);
public TRes VisitExprCase(ExprCase exprCase, ExprValueTypeAnalyzerCtx <TRes, TCtx> ctx) { return(exprCase.DefaultValue.Accept(this, ctx)); }