And one more touch to ExplicitList
parent
ca42178eff
commit
c3dc3b6074
|
@ -761,6 +761,13 @@ autocheckCases =
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
#test issue 18c
|
||||||
|
func =
|
||||||
|
[ (abc, (1111, 1111))
|
||||||
|
, (def, (2, 2))
|
||||||
|
, foo -- comment
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -770,8 +777,6 @@ autocheckCases =
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## this testcase is not about idempotency, but about _how_ the output differs
|
## this testcase is not about idempotency, but about _how_ the output differs
|
||||||
## from the input; i cannot really express this yet with the current
|
## from the input; i cannot really express this yet with the current
|
||||||
## test-suite.
|
## test-suite.
|
||||||
|
|
|
@ -574,6 +574,7 @@ layoutExpr lexpr@(L _ expr) = docWrapNode lexpr $ case expr of
|
||||||
unknownNodeError "HsDo{} no comp" lexpr
|
unknownNodeError "HsDo{} no comp" lexpr
|
||||||
ExplicitList _ _ elems@(_:_) -> do
|
ExplicitList _ _ elems@(_:_) -> do
|
||||||
elemDocs <- elems `forM` docSharedWrapper layoutExpr
|
elemDocs <- elems `forM` docSharedWrapper layoutExpr
|
||||||
|
hasComments <- hasAnyCommentsBelow lexpr
|
||||||
case splitFirstLast elemDocs of
|
case splitFirstLast elemDocs of
|
||||||
FirstLastEmpty -> docSeq
|
FirstLastEmpty -> docSeq
|
||||||
[ docLit $ Text.pack "["
|
[ docLit $ Text.pack "["
|
||||||
|
@ -594,12 +595,14 @@ layoutExpr lexpr@(L _ expr) = docWrapNode lexpr $ case expr of
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
FirstLast e1 ems eN ->
|
FirstLast e1 ems eN ->
|
||||||
docAlt
|
docAltFilter
|
||||||
[ docSeq
|
[ (,) (not hasComments)
|
||||||
|
$ docSeq
|
||||||
$ [docLit $ Text.pack "["]
|
$ [docLit $ Text.pack "["]
|
||||||
++ List.intersperse docCommaSep (docForceSingleline <$> (e1:ems ++ [docNodeAnnKW lexpr (Just AnnOpenS) eN]))
|
++ List.intersperse docCommaSep (docForceSingleline <$> (e1:ems ++ [docNodeAnnKW lexpr (Just AnnOpenS) eN]))
|
||||||
++ [docLit $ Text.pack "]"]
|
++ [docLit $ Text.pack "]"]
|
||||||
, let
|
, (,) True
|
||||||
|
$ let
|
||||||
start = docCols ColList
|
start = docCols ColList
|
||||||
[appSep $ docLit $ Text.pack "[", e1]
|
[appSep $ docLit $ Text.pack "[", e1]
|
||||||
linesM = ems <&> \d ->
|
linesM = ems <&> \d ->
|
||||||
|
|
Loading…
Reference in New Issue