@@ -280,6 +280,8 @@ replaceSplits l ups = updateRHSs 1 (map (rep (expandBraces l)) ups)
280280 nshow t = show t
281281
282282 -- if there's any {n} replace with {n=n}
283+ -- but don't replace it in comments
284+ expandBraces ('{' : '-' : xs) = '{' : '-' : xs
283285 expandBraces ('{' : xs)
284286 = let (brace, (_:rest)) = span (/= '}') xs in
285287 if (not ('=' `elem` brace))
@@ -298,7 +300,7 @@ replaceSplits l ups = updateRHSs 1 (map (rep (expandBraces l)) ups)
298300 if (before == n && not (isAlphaNum next))
299301 then addBrackets tm ++ updatePat False n tm after
300302 else c : updatePat (not (isAlphaNum c)) n tm rest
301− updatePat start n tm (c:rest) = c : updatePat (not (isAlpha c)) n tm rest
303+ updatePat start n tm (c:rest) = c : updatePat (not ((isAlphaNum c) || c == '_')) n tm rest
302304
303305 addBrackets tm | ' ' `elem` tm
304306 , not (isPrefixOf "(" tm)