infer
[minfp.git] / parse.icl
index 5bb4bac..7d4fb2e 100644 (file)
--- a/parse.icl
+++ b/parse.icl
@@ -67,7 +67,7 @@ pTop = getState >>= \s->case s.tokens of
 pEof :: Parser ()
 pEof = getState >>= \s->case s.tokens of
        [] = pure ()
-       [t:ts] = liftT (Left ["Expected EOF"])
+       [t:ts] = liftT (Left ["Expected EOF but got ":map toString [t:ts]])
 
 (?) infixl 9 :: (Parser a) (a -> Bool) -> Parser a
 (?) p f = p >>= \v->if (f v) (pure v) empty