+ parseCall = do
+ func <- lift (munch1 isAlpha)
+ params <- lift $ between (char '(') (char ')') $
+ sepBy (readS_to_P reads)
+ (skipSpaces >> char ',' >> skipSpaces)
+ return (Call func params)
+ parseIf = do
+ spaced $ string "if"
+ cond <- readPrec
+ spaced $ string "then"
+ thenE <- readPrec
+ spaced $ string "else"
+ elseE <- readPrec
+ return (If cond thenE elseE)
+ parseFor = do
+ spaced $ string "for"
+ identifier <- lift (munch1 isAlpha)
+ spaced $ char '='
+ start <- readPrec
+ spaced $ char ','
+ cond <- readPrec
+ stp <- (spaced (char ',') >> Just <$> step readPrec)
+ <++ pure Nothing
+ spaced $ string "in"
+ body <- readPrec
+ return (For identifier start cond stp body)
+ spaced f = lift $ skipSpaces >> f >> skipSpaces