Skip to content

Commit 0ac10df

Browse files
committed
Method rename and other minor changes
1 parent f2f190b commit 0ac10df

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Rubberduck.CodeAnalysis/Inspections/Concrete/UnreachableCaseInspection/ParseTreeValueVisitor.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface IParseTreeValueVisitor : IParseTreeVisitor<IParseTreeVisitorRes
1616

1717
public interface ITestParseTreeVisitor
1818
{
19-
bool IsVBStringConstantToLiteral(string token, out string literalValue);
19+
bool IsVBStringConstant(string token, out string literalValue);
2020
bool IsNonPrintingControlCharacter(string token);
2121
void InjectValuedDeclarationEvaluator(Func<Declaration, (bool, string, string)> func);
2222
}
@@ -336,7 +336,7 @@ private void GetContextValue(ParserRuleContext context, out string declaredTypeN
336336
expressionValue = ExpressionValue;
337337
declaredTypeName = TypeName;
338338

339-
if (IsVBStringConstantToLiteral(expressionValue, out string constLiteral))
339+
if (IsVBStringConstant(expressionValue, out string constLiteral))
340340
{
341341
declaredTypeName = Tokens.String;
342342
expressionValue = constLiteral;
@@ -450,20 +450,14 @@ private static bool IsBinaryOpEvaluationContext<T>(T context)
450450
return false;
451451
}
452452

453-
public bool IsVBStringConstantToLiteral(string candidate, out string literal)
454-
{
455-
return _vbStringConstants.TryGetValue(candidate, out literal);
456-
}
453+
public bool IsVBStringConstant(string candidate, out string literal)
454+
=> _vbStringConstants.TryGetValue(candidate, out literal);
457455

458456
public bool IsNonPrintingControlCharacter(string controlChar)
459-
{
460-
return controlChar != null && _vbStringConstants.ContainsValue(controlChar);
461-
}
457+
=> controlChar != null && _vbStringConstants.ContainsValue(controlChar);
462458

463459
public void InjectValuedDeclarationEvaluator( Func<Declaration, (bool, string, string)> func)
464-
{
465-
ValuedDeclarationEvaluator = func;
466-
}
460+
=> ValuedDeclarationEvaluator = func;
467461

468462
private void LoadEnumMemberValues()
469463
{

RubberduckTests/Inspections/UnreachableCase/UnreachableCaseInspectionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ End Sub
24552455
public void UnreachableCaseInspection_VbStringConstantToLiteral_AreEqual(string constToken, string expected)
24562456
{
24572457
var parseTreeValueVisitor = new ParseTreeValueVisitor(null, new List<VBAParser.EnumerationStmtContext>(), null) as ITestParseTreeVisitor;
2458-
if (parseTreeValueVisitor.IsVBStringConstantToLiteral(constToken, out string literalValue))
2458+
if (parseTreeValueVisitor.IsVBStringConstant(constToken, out string literalValue))
24592459
{
24602460
Assert.AreEqual(expected, literalValue);
24612461
return;

0 commit comments

Comments
 (0)