aboutsummaryrefslogtreecommitdiff
path: root/src/Error.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-08-16 23:37:40 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-08-16 23:37:40 +0100
commit007b1e966d4234f2fbdc8f21d53b27dec0060b5e (patch)
tree99e02aa703470bff74f4711d1c3bd91379b897e5 /src/Error.hs
parent7ac5c089d447c11bb9c9152bb30e1cff5b96267e (diff)
downloadmicro-lang-hs-007b1e966d4234f2fbdc8f21d53b27dec0060b5e.tar.gz
micro-lang-hs-007b1e966d4234f2fbdc8f21d53b27dec0060b5e.zip
Unexpected return error
Diffstat (limited to 'src/Error.hs')
-rw-r--r--src/Error.hs3
1 files changed, 3 insertions, 0 deletions
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 =