Commit f57625da authored by Camil Staps's avatar Camil Staps 🐧

Cleanup

parent 9db34d7b
......@@ -21,13 +21,6 @@ print ps (CharacterClass False cc)
| length ccs == 1 = hd ccs
| otherwise = "[" + concat ccs + "]"
where ccs = printCharClasses cc
print ps (CharacterClass False [('\0','\255')]) = "."
print ps (CharacterClass n cs) = "[" <+ if n "^" "" <+ foldl (<++) "" cs <+ "]"
where
(<++) infixr 5 :: String (Char,Char) -> String
(<++) s (c1,c2)
| c1 == c2 = s <+ c1
| otherwise = s <+ c1 <+ "-" <+ c2
print ps (Concat rgxs) = parens ps $ foldl (+) r rs
where [r:rs] = map (print True) rgxs
print ps (Any rgxs) = parens ps $ foldl (\x s -> x + "|" + s) r rs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment