Fix infix matches with more than 2 args, fixes #219
parent
6879436e67
commit
0795a39806
|
@ -330,6 +330,15 @@ x *** y = x
|
|||
#test symbol prefix
|
||||
(***) 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,9 +341,23 @@ layoutPatternBind funId binderDoc lmatch@(L _ match) = do
|
|||
_ -> pure Nothing
|
||||
let mIdStr' = fixPatternBindIdentifier match <$> mIdStr
|
||||
patDoc <- docWrapNodePrior lmatch $ case (mIdStr', patDocs) of
|
||||
(Just idStr, p1 : pr) | isInfix -> docCols
|
||||
ColPatternsFuncInfix
|
||||
( [appSep $ docForceSingleline p1, appSep $ docLit idStr]
|
||||
(Just idStr, p1:p2:pr) | isInfix -> if null pr
|
||||
then
|
||||
docCols ColPatternsFuncInfix
|
||||
[ 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
|
||||
|
|
Loading…
Reference in New Issue