on master help sign in
Fixed case-splitting

On case-splitting "x" in "test_x x = ..." it was replacing both occurences of "x" (including that one in "test_x"). Most likely this fix does not cover all the possible cases and it should be fixed further.

commit328e4ff7d5f2d90b5108dd3e06850e0f99572cb3 authordefanor <defanor@uberspace.net> dateMon 2 Jun 2014, 22:27 (12 years ago) parentdcd9568
1 file changed+1−1
src/Idris/CaseSplit.hs+1−1
src/Idris/CaseSplit.hs+1−1
@@ -298,7 +298,7 @@ replaceSplits l ups = updateRHSs 1 (map (rep (expandBraces l)) ups)
298298 if (before == n && not (isAlphaNum next))
299299 then addBrackets tm ++ updatePat False n tm after
300300 else c : updatePat (not (isAlphaNum c)) n tm rest
301− updatePat start n tm (c:rest) = c : updatePat (not (isAlpha c)) n tm rest
301+ updatePat start n tm (c:rest) = c : updatePat (not ((isAlphaNum c) || c == '_')) n tm rest
302302
303303 addBrackets tm | ' ' `elem` tm
304304 , not (isPrefixOf "(" tm)