aboutsummaryrefslogtreecommitdiff
path: root/src/Micro/Error.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-09-12 08:01:09 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-09-12 08:01:09 +0100
commitb78d4f28adee1d0dab1dd7626650a3c767cd7cb8 (patch)
tree268eab7bb2ccdbc739ee454964ba8ff5c730ea19 /src/Micro/Error.hs
parentdf9f7c237f61ab0e3aeae28be3d6187d273d1996 (diff)
downloadmicro-lang-hs-b78d4f28adee1d0dab1dd7626650a3c767cd7cb8.tar.gz
micro-lang-hs-b78d4f28adee1d0dab1dd7626650a3c767cd7cb8.zip
Some checks
Diffstat (limited to 'src/Micro/Error.hs')
-rw-r--r--src/Micro/Error.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Micro/Error.hs b/src/Micro/Error.hs
index ced1318..e82c0da 100644
--- a/src/Micro/Error.hs
+++ b/src/Micro/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 | InvalidTarget deriving (Show)
+data ErrorType = GenericError | TypeError | UnexpectedReturn | AlreadyDefined | NonCallable | Undefined | UndefinedType | InvalidTarget | InvalidOperation deriving (Show)
instance Enum ErrorType where
fromEnum GenericError = 0
@@ -15,6 +15,7 @@ instance Enum ErrorType where
fromEnum Undefined = 5
fromEnum UndefinedType = 6
fromEnum InvalidTarget = 7
+ fromEnum InvalidOperation = 8
toEnum _ = error "toEnum is undefined for Error"
data Error = Error ErrorType String SourcePos