Fix bracket bug in case generation
commit2dfba3137bdf8da1df87b3fa5ac599e8c2ea7639
authorEdwin Brady <ecb10@st-andrews.ac.uk>
dateSun 10 Apr 2016, 22:32 (11 years ago)
parent6c51f87
src/Idris/CaseSplit.hs+2−2
@@ -349,8 +349,8 @@ replaceSplits l ups impossible
349349 updatePat start n tm (c:rest) = c : updatePat (not ((isAlphaNum c) || c == '_')) n tm rest
350350
351351 addBrackets tm | ' ' `elem` tm
352− , not (isPrefixOf "(" tm)
353− , not (isSuffixOf ")" tm) = "(" ++ tm ++ ")"
352+ , not (isPrefixOf "(" tm && isSuffixOf ")" tm)
353+ = "(" ++ tm ++ ")"
354354 | otherwise = tm
355355
356356