Fix let-in-expr non-idempotent comment placement
parent
301f7cbbbd
commit
2ff31d5811
|
@ -1113,3 +1113,16 @@ func = do
|
||||||
func arg = abc ++ def ++ case arg of
|
func arg = abc ++ def ++ case arg of
|
||||||
False -> ghi
|
False -> ghi
|
||||||
True -> jkl
|
True -> jkl
|
||||||
|
|
||||||
|
#test non-idempotent comment position with let-in-where
|
||||||
|
otherFunc very long patterrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrn
|
||||||
|
= let
|
||||||
|
localfunc a b c = a <> b <> c
|
||||||
|
someThing = fromList [abc, def, ghi]
|
||||||
|
in -- abc
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||||
|
+ ccccccc
|
||||||
|
where
|
||||||
|
ccccccc = "abc"
|
||||||
|
ddddd = True
|
||||||
|
|
|
@ -553,10 +553,11 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
]
|
]
|
||||||
, docAlt
|
, docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
[ appSep $ wrapIn $ docLit $ Text.pack $ ifIndentFreeElse
|
[ appSep $ wrapIn $ docLit $ Text.pack "in"
|
||||||
"in "
|
, ifIndentFreeElse ( docSetBaseAndIndent
|
||||||
"in"
|
. docEnsureIndent (BrIndentSpecial 1)
|
||||||
, ifIndentFreeElse docSetBaseAndIndent
|
. docSetBaseAndIndent
|
||||||
|
)
|
||||||
docForceSingleline
|
docForceSingleline
|
||||||
expDoc1
|
expDoc1
|
||||||
]
|
]
|
||||||
|
@ -586,6 +587,7 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
)
|
)
|
||||||
, docSeq
|
, docSeq
|
||||||
[ wrapIn $ docLit $ Text.pack "in"
|
[ wrapIn $ docLit $ Text.pack "in"
|
||||||
|
, docSeparator
|
||||||
, docAddBaseY BrIndentRegular $ docForceParSpacing expDoc1
|
, docAddBaseY BrIndentRegular $ docForceParSpacing expDoc1
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
@ -599,7 +601,9 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
]
|
]
|
||||||
, docSeq
|
, docSeq
|
||||||
[ appSep $ wrapIn $ docLit $ Text.pack "in"
|
[ appSep $ wrapIn $ docLit $ Text.pack "in"
|
||||||
, docSetBaseY expDoc1
|
, docSetBaseY
|
||||||
|
$ docEnsureIndent (BrIndentSpecial 1)
|
||||||
|
$ docSetBaseY expDoc1
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
addAlternative $ docLines
|
addAlternative $ docLines
|
||||||
|
|
|
@ -143,7 +143,7 @@ layoutWriteComment absolute isBlock dp commentLines s = do
|
||||||
' '
|
' '
|
||||||
mTell $ Text.Builder.fromText s
|
mTell $ Text.Builder.fromText s
|
||||||
traceLocal
|
traceLocal
|
||||||
( "layoutMoveToCommentPos"
|
( "layoutWriteComment"
|
||||||
, y
|
, y
|
||||||
, x
|
, x
|
||||||
, commentLines
|
, commentLines
|
||||||
|
|
Loading…
Reference in New Issue