Fix infix matches with more than 2 args, fixes #219
parent
6879436e67
commit
0795a39806
|
@ -330,6 +330,15 @@ x *** y = x
|
||||||
#test symbol prefix
|
#test symbol prefix
|
||||||
(***) x y = x
|
(***) x y = x
|
||||||
|
|
||||||
|
#test infix more args simple
|
||||||
|
(f >=> g) k = f k >>= g
|
||||||
|
|
||||||
|
#test infix more args alignment
|
||||||
|
(Left a <$$> Left dd) e f = True
|
||||||
|
(Left a <$$> Right d ) e f = True
|
||||||
|
(Right a <$$> Left d ) e f = False
|
||||||
|
(Right a <$$> Right dd) e f = True
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -341,11 +341,25 @@ layoutPatternBind funId binderDoc lmatch@(L _ match) = do
|
||||||
_ -> pure Nothing
|
_ -> pure Nothing
|
||||||
let mIdStr' = fixPatternBindIdentifier match <$> mIdStr
|
let mIdStr' = fixPatternBindIdentifier match <$> mIdStr
|
||||||
patDoc <- docWrapNodePrior lmatch $ case (mIdStr', patDocs) of
|
patDoc <- docWrapNodePrior lmatch $ case (mIdStr', patDocs) of
|
||||||
(Just idStr, p1 : pr) | isInfix -> docCols
|
(Just idStr, p1:p2:pr) | isInfix -> if null pr
|
||||||
ColPatternsFuncInfix
|
then
|
||||||
( [appSep $ docForceSingleline p1, appSep $ docLit idStr]
|
docCols ColPatternsFuncInfix
|
||||||
++ (spacifyDocs $ docForceSingleline <$> pr)
|
[ appSep $ docForceSingleline p1
|
||||||
)
|
, appSep $ docLit $ idStr
|
||||||
|
, docForceSingleline p2
|
||||||
|
]
|
||||||
|
else
|
||||||
|
docCols ColPatternsFuncInfix
|
||||||
|
( [docCols ColPatterns
|
||||||
|
[ docParenL
|
||||||
|
, appSep $ docForceSingleline p1
|
||||||
|
, appSep $ docLit $ idStr
|
||||||
|
, docForceSingleline p2
|
||||||
|
, appSep $ docParenR
|
||||||
|
]
|
||||||
|
]
|
||||||
|
++ (spacifyDocs $ docForceSingleline <$> pr)
|
||||||
|
)
|
||||||
(Just idStr, []) -> docLit idStr
|
(Just idStr, []) -> docLit idStr
|
||||||
(Just idStr, ps) ->
|
(Just idStr, ps) ->
|
||||||
docCols ColPatternsFuncPrefix
|
docCols ColPatternsFuncPrefix
|
||||||
|
|
Loading…
Reference in New Issue