From 007b1e966d4234f2fbdc8f21d53b27dec0060b5e Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 16 Aug 2022 23:37:40 +0100 Subject: Unexpected return error --- src/Error.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Error.hs') diff --git a/src/Error.hs b/src/Error.hs index b528f9e..1363120 100644 --- a/src/Error.hs +++ b/src/Error.hs @@ -6,6 +6,7 @@ import Text.Parsec.Error (ParseError, errorMessages, showErrorMessages) data Error = TypeError String SourcePos + | UnexpectedReturn String SourcePos | Error String SourcePos deriving (Eq) @@ -15,6 +16,8 @@ instance Show Error where -- XXX: can we do this differently? show (TypeError message pos) = show pos ++ " error: " ++ message + show (UnexpectedReturn message pos) = + show pos ++ " error: " ++ message showParserError :: ParseError -> String showParserError error = -- cgit v1.2.3