diff --git a/Logic/Parse.hs b/Logic/Parse.hs index f203fbe..b98744f 100644 --- a/Logic/Parse.hs +++ b/Logic/Parse.hs @@ -79,9 +79,9 @@ parseToken token = Parser parse | otherwise = Left $ expected (show token) input parseIf :: Show s => String -> (s -> Bool) -> Parser s s -parseIf description check = Parser $ \input -> - case inputSeq input of - [] -> Left $ ParseError (inputPos input) "unexpected end of input" +parseIf description check = Parser $ \input@(Input pos xs) -> + case xs of + [] -> Left $ ParseError pos "unexpected end of input" (char:chars) - | check char -> Right $ (char,) $ Input (inputPos input + 1) chars + | check char -> Right $ (char,) $ Input (pos + 1) chars | otherwise -> Left $ expected description input