aboutsummaryrefslogtreecommitdiff
path: root/src/Error.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-09-06 22:22:32 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-09-06 22:22:32 +0100
commitd08042be1e0ae158f124bb6848f5843a804a6544 (patch)
tree71ffa63234c13f3bf7d31fe3c0a3876839cae2e8 /src/Error.hs
parentf8dfbfc1604aea626a6502b9f6d06ea1299a0cdb (diff)
downloadmicro-lang-hs-d08042be1e0ae158f124bb6848f5843a804a6544.tar.gz
micro-lang-hs-d08042be1e0ae158f124bb6848f5843a804a6544.zip
Assignation
Diffstat (limited to 'src/Error.hs')
-rw-r--r--src/Error.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Error.hs b/src/Error.hs
index 9aad85d..d128d32 100644
--- a/src/Error.hs
+++ b/src/Error.hs
@@ -4,7 +4,7 @@ import Data.List (sort)
import Text.Parsec (SourcePos, errorPos)
import Text.Parsec.Error (ParseError, errorMessages, showErrorMessages)
-data ErrorType = GenericError | TypeError | UnexpectedReturn | AlreadyDefined | NonCallable | Undefined | UndefinedType deriving (Show)
+data ErrorType = GenericError | TypeError | UnexpectedReturn | AlreadyDefined | NonCallable | Undefined | UndefinedType | InvalidTarget deriving (Show)
instance Enum ErrorType where
fromEnum GenericError = 0
@@ -14,6 +14,7 @@ instance Enum ErrorType where
fromEnum NonCallable = 4
fromEnum Undefined = 5
fromEnum UndefinedType = 6
+ fromEnum InvalidTarget = 7
toEnum _ = error "toEnum is undefined for Error"
data Error = Error ErrorType String SourcePos