aboutsummaryrefslogtreecommitdiff
path: root/src/Compiler.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-08-13 08:14:18 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-08-13 08:14:18 +0100
commit326386322d26b633672de37f045a53f18f2336a5 (patch)
treef2f26d1b94fd79d01cfc97377a1b4e66c57ee1c1 /src/Compiler.hs
parentd1fc24d2f17ca1649717c76a130db3869b6abc88 (diff)
downloadmicro-lang-hs-326386322d26b633672de37f045a53f18f2336a5.tar.gz
micro-lang-hs-326386322d26b633672de37f045a53f18f2336a5.zip
Probably better
Diffstat (limited to 'src/Compiler.hs')
-rw-r--r--src/Compiler.hs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Compiler.hs b/src/Compiler.hs
index fc4d9e6..ea97bb8 100644
--- a/src/Compiler.hs
+++ b/src/Compiler.hs
@@ -8,10 +8,6 @@ import System.Environment (getEnv, getEnvironment)
import Text.Parsec (ParseError, SourcePos)
import Text.Read (Lexeme (String))
-toFuncType :: [A.FuncParam] -> Maybe A.Type -> A.Type
-toFuncType params rtyp =
- A.FuncType (map (\(_, t, _) -> t) params) rtyp
-
type CompState = (Env, [Error])
type CompResult = Either [Error] ()
@@ -29,7 +25,7 @@ compile (x : xs) = do
(ev, errs) <- get
-- with function and parameters
(nev, nerrs) <-
- return $ case addSymUniq ev (ident, toFuncType params ret, pos) of
+ return $ case addSymUniq ev (ident, A.toFuncType params ret, pos) of
Left e -> (ev, e : errs)
Right fev ->
foldl