Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Text.ParserCombinators.Parsec
- mah = do
- char '{'
- res <- li
- char '}'
- return res
- li = sepBy item (char ',')
- item = sepBy foo (char ':')
- foo = many (noneOf ",:\n")
- -- If this is uncommented it won't compile
- -- eol = char '\n'
- pli :: String -> Either ParseError [[String]]
- pli input = parse li "off" input
- test = "{lhs: \"133 + 234\",rhs: \"367\",error: \"\",icc: false}"
Add Comment
Please, Sign In to add comment