parseStatement :: String -> Either String Expr
parseStatement x = case parse (whiteSpace >> statement) "" x of
    Left err -> Left $ show err
    Right ast -> Right . head . removeParens . indirPass $ [ast]

-- preprocesses and parses text; returns an error or an AST
-- parseText contents fname will parse contents and report errors as coming from fname
parseStatement :: String -> Either String Expr
parseStatement x = case parse (whiteSpace >> statement) "" x of
    Left err -> Left $ show err
    Right ast -> Right . head . removeParens . indirPass $ [ast]

-- preprocesses and parses text; returns an error or an AST
-- parseText contents fname will parse contents and report errors as coming from fname
parseStatement x = case parse (whiteSpace >> statement) "" x of
    Left err -> Left $ show err
    Right ast -> Right . head . removeParens . indirPass $ [ast]

-- preprocesses and parses text; returns an error or an AST
-- parseText contents fname will parse contents and report errors as coming from fname