Allow ] as the first character of a character class

parent 042b7f0e
......@@ -116,8 +116,8 @@ singleChar [c:cs]
= Just (c,cs)
charClass :: [(Char,Char)] [Char] -> Maybe ([(Char,Char)], [Char])
charClass _ [] = Nothing
charClass cls [']':cs] = Just (cls,cs)
charClass _ [] = Nothing
charClass cls=:[_:_] [']':cs] = Just (cls,cs)
charClass cls cs = (try_chars <|> shorthandClass cs) >>=
\(cls`,cs`) -> charClass (cls ++ cls`) cs`
where
......
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