hi
 
I have a function parseInt... which needs an error guard for when the input is not an Int.
 
parseInt :: Parser
parseInt [] = []
parseInt xs = let (digits, rest) = span isDigit (removeSpace xs)
                in [(EInt (read digits), removeSpace rest)]
 
Also... I have a function that does this... parseBinaryOp "+" "(5 + 2) if"      gives...[(Int 5, Int 2, "if")]
so, op is '+' or "&&". I am unsure of how to begin...
 
parseBinaryOp :: String -> String -> [(Expr, Expr, String)]
parseBinaryOp op str
 
Thankyou
 
Ryan

Are you the Quizmaster? Play BrainBattle with a friend now!