public override int GetLineCount() { return(TestTranslation.GetLineCount() + IfTrueTranslation.GetLineCount() + 1 + // for space after the if statement IfFalseTranslation.GetLineCount()); }
private void WriteSingleLineTernary(TranslationBuffer buffer) { TestTranslation.WriteInParenthesesIfRequired(buffer); buffer.WriteToTranslation(" ? "); IfTrueTranslation.WriteTo(buffer); buffer.WriteToTranslation(" : "); IfFalseTranslation.WriteTo(buffer); }
private void WriteSingleLineTernary(TranslationWriter writer) { TestTranslation.WriteInParenthesesIfRequired(writer, _context); writer.WriteToTranslation(" ? "); IfTrueTranslation.WriteTo(writer); writer.WriteToTranslation(" : "); IfFalseTranslation.WriteTo(writer); }
private void WriteMultiLineTernary(TranslationBuffer buffer) { TestTranslation.WriteInParenthesesIfRequired(buffer); buffer.WriteNewLineToTranslation(); buffer.Indent(); buffer.WriteToTranslation("? "); IfTrueTranslation.WriteTo(buffer); buffer.WriteNewLineToTranslation(); buffer.WriteToTranslation(": "); IfFalseTranslation.WriteTo(buffer); buffer.Unindent(); }
private void WriteMultiLineTernary(TranslationWriter writer) { TestTranslation.WriteInParenthesesIfRequired(writer, _context); writer.WriteNewLineToTranslation(); writer.Indent(); writer.WriteToTranslation("? "); IfTrueTranslation.WriteTo(writer); writer.WriteNewLineToTranslation(); writer.WriteToTranslation(": "); IfFalseTranslation.WriteTo(writer); writer.Unindent(); }
private int GetSingleLineTernaryLineCount() { var lineCount = TestTranslation.GetLineCount(); var ifTrueLineCount = IfTrueTranslation.GetLineCount(); if (ifTrueLineCount > 1) { lineCount += ifTrueLineCount - 1; } var ifFalseLineCount = IfFalseTranslation.GetLineCount(); if (ifFalseLineCount > 1) { lineCount += ifFalseLineCount - 1; } return(lineCount); }
protected void WriteIfStatement(TranslationBuffer buffer) { buffer.WriteToTranslation("if "); TestTranslation.WriteInParentheses(buffer); IfTrueTranslation.WriteTo(buffer); }
public override int GetLineCount() { return(TestTranslation.GetLineCount() + IfTrueTranslation.GetLineCount() + IfFalseTranslation.GetLineCount()); }
public override int GetIndentSize() { return(TestTranslation.GetIndentSize() + IfTrueTranslation.GetIndentSize() + IfFalseTranslation.GetIndentSize()); }
private int GetMultiLineTernaryLineCount() { return(TestTranslation.GetLineCount() + IfTrueTranslation.GetLineCount() + IfFalseTranslation.GetLineCount()); }
private int GetSingleLineTernaryIndentSize() { return(TestTranslation.GetLineCount() + IfTrueTranslation.GetIndentSize() + IfFalseTranslation.GetIndentSize()); }
public override int GetLineCount() => TestTranslation.GetLineCount() + IfTrueTranslation.GetLineCount();
public override int GetIndentSize() => TestTranslation.GetIndentSize() + IfTrueTranslation.GetIndentSize();
protected void WriteIfStatement(TranslationWriter writer) { writer.WriteControlStatementToTranslation("if "); TestTranslation.WriteInParentheses(writer); IfTrueTranslation.WriteTo(writer); }