public override AstVisitAction VisitTernaryExpression(TernaryExpressionAst ternaryExpressionAst) { var helpResult = HelpTableQuery("about_if"); helpResult.DocumentationLink += "#using-the-ternary-operator-syntax"; explanations.Add(new Explanation() { Description = $"A condensed if-else construct, used for simple situations.", CommandName = "Ternary expression", HelpResult = helpResult, TextToHighlight = "?" }.AddDefaults(ternaryExpressionAst, explanations)); return(base.VisitTernaryExpression(ternaryExpressionAst)); }
public override AstVisitAction VisitTernaryExpression(TernaryExpressionAst ternaryExpressionAst) { if (!TargetsNonPS7()) { return(AstVisitAction.Continue); } var correction = new CorrectionExtent( ternaryExpressionAst.Extent, $"if ({ternaryExpressionAst.Condition.Extent.Text}) {{ {ternaryExpressionAst.IfTrue.Extent.Text} }} else {{ {ternaryExpressionAst.IfFalse.Extent.Text} }}", _analyzedFilePath); AddDiagnostic( ternaryExpressionAst, "ternary expression", "<test> ? <exp1> : <exp2>", "3,4,5,6", correction); return(AstVisitAction.Continue); }
public override AstVisitAction VisitTernaryExpression(TernaryExpressionAst ternaryExpressionAst) { return(AstVisitAction.SkipChildren); }
/// <summary/> public virtual AstVisitAction VisitTernaryExpression(TernaryExpressionAst ternaryExpressionAst) => DefaultVisit(ternaryExpressionAst);
public override AstVisitAction VisitTernaryExpression(TernaryExpressionAst ternaryExpressionAst) { return(Visit(ternaryExpressionAst)); }