Fix non-idempotent transformation of partly documented data definition

This commit is contained in:
Mark Karpov 2020-05-14 17:15:15 +02:00
parent b0092e11a1
commit 1fb65a218c
5 changed files with 14 additions and 9 deletions

View File

@ -32,6 +32,9 @@
syntax. [Issue 445](https://github.com/tweag/ormolu/issues/445) and [Issue
428](https://github.com/tweag/ormolu/issues/428).
* Fixed non-idempotent transformation of partly documented data definition.
[Issue 590](https://github.com/tweag/ormolu/issues/590).
* Renamed the `--check-idempotency` flag to `--check-idempotence`.
Apparently only the latter is correct.

View File

@ -0,0 +1,5 @@
data Optimisation
= PETransform
| -- | partial eval and associated transforms
GeneralisedNatHack
deriving (Show, Eq, Generic)

View File

@ -0,0 +1,2 @@
data Optimisation = PETransform | GeneralisedNatHack -- ^ partial eval and associated transforms
deriving (Show, Eq, Generic)

View File

@ -10,12 +10,6 @@ Formatting is not idempotent:
after: " text op\n <"
Please, consider reporting the bug.
Formatting is not idempotent:
src/Idris/Options.hs<rendered>:178:15
before: "ETransform | -- | pa"
after: "ETransform\n | -- | "
Please, consider reporting the bug.
The GHC parser (in Haddock mode) failed:
src/Idris/Parser.hs:1052:1
parse error on input `@'

View File

@ -72,10 +72,11 @@ p_dataDecl style name tpats fixity HsDataDefn {..} = do
else breakpoint
equals
space
layout <- getLayout
let s =
vlayout
(space >> txt "|" >> space)
(newline >> txt "|" >> space)
if layout == MultiLine || hasHaddocks dd_cons
then newline >> txt "|" >> space
else space >> txt "|" >> space
sitcc' =
if singleConstRec
then id