-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Description
-(-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.
Here's how I implemented it for elm-syntax: https://github.com/lue-bird/elm-syntax-format/blob/main/src/ElmSyntaxPrintDefunctionalized.elm#L5355-L5406
Metadata
Metadata
Assignees
Labels
No labels