From d08042be1e0ae158f124bb6848f5843a804a6544 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 6 Sep 2022 22:22:32 +0100 Subject: Assignation --- src/Error.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Error.hs') 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 -- cgit v1.2.3