Skip to content

Commit a67ebe3

Browse files
committed
Renames for clarity + consistency
1 parent 4adfded commit a67ebe3

10 files changed

+14
-14
lines changed

ReadableExpressions/ReadableExpressions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<Compile Include="Translators\DynamicExpressionTranslator.cs" />
5757
<Compile Include="Translators\ExtensionExpressionTranslator.cs" />
5858
<Compile Include="Translators\Formatting\FormattableExpressionBase.cs" />
59-
<Compile Include="Translators\Formatting\TernaryExpression.cs" />
59+
<Compile Include="Translators\Formatting\TernaryFormatter.cs" />
6060
<Compile Include="Translators\GotoExpressionTranslator.cs" />
6161
<Compile Include="Translators\IMethodInfo.cs" />
6262
<Compile Include="Translators\IndexAccessExpressionTranslator.cs" />

ReadableExpressions/StringExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static string[] SplitToLines(this string line, StringSplitOptions splitOp
3131

3232
private const string IndentSpaces = " ";
3333

34-
public static string Indent(this string line)
34+
public static string Indented(this string line)
3535
{
3636
if (string.IsNullOrEmpty(line))
3737
{
@@ -42,7 +42,7 @@ public static string Indent(this string line)
4242
{
4343
return string.Join(
4444
Environment.NewLine,
45-
line.SplitToLines().Select(l => l.Indent()));
45+
line.SplitToLines().Select(l => l.Indented()));
4646
}
4747

4848
return IndentSpaces + line;

ReadableExpressions/Translators/AssignmentExpressionTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static string AdjustForCheckedAssignmentIfAppropriate(
9797
return $@"
9898
checked
9999
{{
100-
{assignment.Indent()}
100+
{assignment.Indented()}
101101
}}".TrimStart();
102102
}
103103

ReadableExpressions/Translators/BinaryExpressionTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private static string AdjustForCheckedOperatorIfAppropriate(
108108
return $@"
109109
checked
110110
{{
111-
{operation.TrimStart().Indent()}
111+
{operation.TrimStart().Indented()}
112112
}}".TrimStart();
113113
}
114114

ReadableExpressions/Translators/ConditionalExpressionTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public override string Translate(Expression expression, TranslationContext conte
2828

2929
if (IsTernary(conditional))
3030
{
31-
return new TernaryExpression(conditional.Test, ifTrueBlock, ifFalseBlock, context);
31+
return new TernaryFormatter(conditional.Test, ifTrueBlock, ifFalseBlock, context);
3232
}
3333

3434
var test = GetTest(conditional, context);

ReadableExpressions/Translators/Formatting/CodeBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public CodeBlock Indented()
4040

4141
return new CodeBlock(
4242
_expression,
43-
_blockLines.Select(line => line.Indent()).ToArray());
43+
_blockLines.Select(line => line.Indented()).ToArray());
4444
}
4545

4646
public CodeBlock Insert(params string[] lines)

ReadableExpressions/Translators/Formatting/ParameterSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected override Func<string> MultipleLineTranslationFactory
199199
{
200200
return () =>
201201
Environment.NewLine +
202-
FormatParameters("," + Environment.NewLine, a => a.Indent());
202+
FormatParameters("," + Environment.NewLine, a => a.Indented());
203203
}
204204
}
205205

ReadableExpressions/Translators/Formatting/TernaryExpression.cs renamed to ReadableExpressions/Translators/Formatting/TernaryFormatter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ namespace AgileObjects.ReadableExpressions.Translators.Formatting
33
using System;
44
using System.Linq.Expressions;
55

6-
internal class TernaryExpression : FormattableExpressionBase
6+
internal class TernaryFormatter : FormattableExpressionBase
77
{
8-
public TernaryExpression(
8+
public TernaryFormatter(
99
Expression condition,
1010
CodeBlock ifTrue,
1111
CodeBlock ifFalse,
@@ -20,9 +20,9 @@ public TernaryExpression(
2020
MultipleLineTranslationFactory = () =>
2121
test +
2222
Environment.NewLine +
23-
("?" + ifTrueString).Indent() +
23+
("?" + ifTrueString).Indented() +
2424
Environment.NewLine +
25-
(":" + ifFalseString).Indent();
25+
(":" + ifFalseString).Indented();
2626
}
2727

2828
private static string GetTest(Expression condition, TranslationContext context)

ReadableExpressions/Translators/InitialisationExpressionTranslator.Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected static string GetInitialisation(string newExpression, string[] memberI
6666

6767
var initialisationBlock = string.Join(
6868
"," + Environment.NewLine,
69-
memberInitialisations.Select(init => init.Indent()));
69+
memberInitialisations.Select(init => init.Indented()));
7070

7171
var initialisation = $@"
7272
{newExpression}

ReadableExpressions/Translators/MethodCallExpressionTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ internal string GetMethodCall(
107107
TranslationContext context)
108108
{
109109
var separator = context.IsPartOfMethodCallChain(originalMethodCall)
110-
? Environment.NewLine + ".".Indent()
110+
? Environment.NewLine + ".".Indented()
111111
: ".";
112112

113113
return subject + separator + GetMethodCall(method, arguments, context);

0 commit comments

Comments
 (0)