diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-08-16 23:10:06 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-08-16 23:10:06 +0100 |
commit | 7b57942b3a10e51fdb7f78d276dc0187a22c3871 (patch) | |
tree | 8af77798f00353dcc77e85aa3e167f7aff9e0ba7 /src/Compiler.hs | |
parent | 55692e10192968ae7f040ceb9a8469b6ce2412c4 (diff) | |
download | micro-lang-hs-7b57942b3a10e51fdb7f78d276dc0187a22c3871.tar.gz micro-lang-hs-7b57942b3a10e51fdb7f78d276dc0187a22c3871.zip |
Test labels, test for errors WIP
Diffstat (limited to 'src/Compiler.hs')
-rw-r--r-- | src/Compiler.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compiler.hs b/src/Compiler.hs index 49af369..da25c5d 100644 --- a/src/Compiler.hs +++ b/src/Compiler.hs @@ -114,7 +114,7 @@ compile x = do Right (Just (A.FuncType params rtyp)) -> do r <- typecheckCall args params case r of - Just err -> addError $ Error err pos + Just err -> addError $ TypeError err pos Nothing -> return $ Right rtyp Right _ -> addError $ Error "non callable value in function call" pos _ -> return $ Right Nothing @@ -125,7 +125,7 @@ compile x = do Just (_, A.FuncType _ rtyp, _) -> do r <- typecheckReturn value rtyp case r of - Just err -> addError $ Error err pos + Just err -> addError $ TypeError err pos Nothing -> return $ Right rtyp (A.Var ident pos) -> do (ev, errs) <- get |