Verified Commit 526028f7 authored by Camil Staps's avatar Camil Staps 🐨

Implement missing cases

parent 38ddb571
......@@ -160,6 +160,8 @@ where
where (ys,zs) = spanMax (n-1) f xs
singleChar [c:cs]
= Ok (c,cs)
singleChar []
= Error "expected character"
charClass :: [(Char,Char)] [Char] -> MaybeErrorString ([(Char,Char)], [Char])
charClass _ [] = Error "unclosed character class"
......
......@@ -36,8 +36,11 @@ where
| f == jt = "{" <+ f <+ "}"
| otherwise = "{" <+ f <+ "," <+ jt <+ "}"
where jt = fromJust t
print ps (Group (NotNamed _) r) = "(" <+ r <+ ")"
print ps (Group (Named n) r) = "(?'" <+ n <+ "'" <+ r <+ ")" // NB: no parsing support yet
print ps StartOfString = "^"
print ps EndOfString = "$"
print ps (WordBreak neg) = if neg "\\B" "\\b"
lz :: Bool -> String
lz True = ""
......
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