You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-(-1) or any other doubly negated expression like -(-a) gets turned into a single-line comment --1 or --a.
The only exception is -(-0) which first gets turned into -0 and on next format turned into 0.
In the first cases, the parens should be preserved. The -(-0) should directly be converted to 0.
Given, this is an extremely rare edge case.
-(-1)
or any other doubly negated expression like-(-a)
gets turned into a single-line comment--1
or--a
.The only exception is
-(-0)
which first gets turned into-0
and on next format turned into0
.In the first cases, the parens should be preserved. The
-(-0)
should directly be converted to0
.Given, this is an extremely rare edge case.
Here's how I implemented it for elm-syntax: https://github.com/lue-bird/elm-syntax-format/blob/main/src/ElmSyntaxPrintDefunctionalized.elm#L5355-L5406
The text was updated successfully, but these errors were encountered: