Guest User

Untitled

a guest
Nov 17th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import Text.ParserCombinators.Parsec
  2.  
  3. mah = do
  4. char '{'
  5. res <- li
  6. char '}'
  7. return res
  8.  
  9. li = sepBy item (char ',')
  10. item = sepBy foo (char ':')
  11. foo = many (noneOf ",:\n")
  12.  
  13. -- If this is uncommented it won't compile
  14. -- eol = char '\n'
  15.  
  16. pli :: String -> Either ParseError [[String]]
  17. pli input = parse li "off" input
  18.  
  19. test = "{lhs: \"133 + 234\",rhs: \"367\",error: \"\",icc: false}"
Add Comment
Please, Sign In to add comment