Skip to content

Commit

Permalink
Fix SyntaxNormalizer turning double unaries into comments.
Browse files Browse the repository at this point in the history
Fixes #122.
  • Loading branch information
GGG-KILLER committed Mar 10, 2024
1 parent 73e1176 commit 308d4ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Compilers/Lua/Portable/Syntax/SyntaxNormalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,9 @@ private TReturn WithTempState<TArg, TReturn>(Func<TArg, TReturn> func, TArg arg)
if (SyntaxFacts.IsKeyword(node.OperatorToken.Kind()))
AddSpaceAfterToken(node.OperatorToken);

if (node.OperatorToken.Kind() is SyntaxKind.MinusToken && node.Operand is UnaryExpressionSyntax { OperatorToken.RawKind: (int) SyntaxKind.MinusToken })
AddSpaceAfterToken(node.OperatorToken);

return base.VisitUnaryExpression(node);
}

Expand Down

0 comments on commit 308d4ff

Please sign in to comment.