diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-09-10 15:14:12 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-09-10 15:14:12 +0100 |
commit | a88e94504679a5aeaf102c975d873cbc14620f61 (patch) | |
tree | a6cbbcf14bae1b2f0c82aa5834492963bb48d17e /src/Micro/Compiler.hs | |
parent | 22c9414d07e6514fd0329fbceb3132766beb3cda (diff) | |
download | micro-lang-hs-a88e94504679a5aeaf102c975d873cbc14620f61.tar.gz micro-lang-hs-a88e94504679a5aeaf102c975d873cbc14620f61.zip |
Not needed
Diffstat (limited to 'src/Micro/Compiler.hs')
-rw-r--r-- | src/Micro/Compiler.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Micro/Compiler.hs b/src/Micro/Compiler.hs index 1b17794..cc71f9c 100644 --- a/src/Micro/Compiler.hs +++ b/src/Micro/Compiler.hs @@ -156,7 +156,7 @@ compile x = do (ev, errs) <- return $ (stEnv st, (verifyFuncType ident params ret pos) ++ stErr st) -- updated with the function (ev, errs) <- - return $ case addSymUniq ev (newSym ident ftype priv False pos) of + return $ case addSymUniq ev (Sym ident ftype priv False pos) of Left err -> (ev, err : errs) Right ev -> (ev, errs) -- lambdas can only access local variables (closures aren't supported) @@ -164,7 +164,7 @@ compile x = do -- with parameters (nev, errs) <- return $ foldlEither addSymUniq (addEnv fev, errs) $ map (toSym True) params -- helper for return - nev <- return $ addSym nev $ newSym "$fn$" ftype True True pos + nev <- return $ addSym nev $ Sym "$fn$" ftype True True pos put st {stEnv = nev, stErr = errs} _ <- compileAll body st <- get @@ -184,7 +184,7 @@ compile x = do _ -> addError $ Error NonCallable "non callable value in function call" pos (A.Var ident typ val priv pos) -> do st <- get - (ev, errs) <- return $ foldlEither addSymUniq (stEnv st, stErr st) [newSym ident typ priv True pos] + (ev, errs) <- return $ foldlEither addSymUniq (stEnv st, stErr st) [Sym ident typ priv True pos] errs <- return $ if not (definedType typ) |