Skip to content

Commit

Permalink
Merge pull request #1151 from LucTremblay/addParensIfNotParenthesized…
Browse files Browse the repository at this point in the history
…Expression

AddParens only if it is not already a ParenthesizedExpressionSyntax
  • Loading branch information
GrahamTheCoder authored Nov 9, 2024
2 parents 1338963 + 1cab219 commit 950ee9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CodeConverter/Util/CSharpUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public static SyntaxKind GetExpressionOperatorTokenKind(SyntaxKind op)
/// </summary>
public static ExpressionSyntax AddParens(this ExpressionSyntax expression)
{
if (expression is ParenthesizedExpressionSyntax)
return expression;
return SyntaxFactory.ParenthesizedExpression(expression);
}

Expand Down

0 comments on commit 950ee9b

Please sign in to comment.