diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-08-30 23:21:50 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-08-30 23:26:10 +0100 |
commit | 90a8f16e5f1d852f21fbbaf2b0631d348973152a (patch) | |
tree | 44f9e3c284a4d5b8f2c8df708cd6592616714acf /src/Error.hs | |
parent | aaf2ef628772e5789203544ac6226b467891d1d9 (diff) | |
download | micro-lang-hs-90a8f16e5f1d852f21fbbaf2b0631d348973152a.tar.gz micro-lang-hs-90a8f16e5f1d852f21fbbaf2b0631d348973152a.zip |
Check undefined types
Diffstat (limited to 'src/Error.hs')
-rw-r--r-- | src/Error.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Error.hs b/src/Error.hs index 40bb046..9aad85d 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 deriving (Show) +data ErrorType = GenericError | TypeError | UnexpectedReturn | AlreadyDefined | NonCallable | Undefined | UndefinedType deriving (Show) instance Enum ErrorType where fromEnum GenericError = 0 @@ -13,6 +13,7 @@ instance Enum ErrorType where fromEnum AlreadyDefined = 3 fromEnum NonCallable = 4 fromEnum Undefined = 5 + fromEnum UndefinedType = 6 toEnum _ = error "toEnum is undefined for Error" data Error = Error ErrorType String SourcePos |