From a88e94504679a5aeaf102c975d873cbc14620f61 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 10 Sep 2022 15:14:12 +0100 Subject: Not needed --- src/Micro/Compiler.hs | 6 +++--- src/Micro/Env.hs | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src') 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) diff --git a/src/Micro/Env.hs b/src/Micro/Env.hs index 9de7248..731f19a 100644 --- a/src/Micro/Env.hs +++ b/src/Micro/Env.hs @@ -15,12 +15,9 @@ data Sym = Sym } deriving (Show) -newSym :: A.Ident -> A.Type -> Bool -> Bool -> SourcePos -> Sym -newSym a b c d e = Sym {symId = a, symType = b, symPriv = c, symRef = d, symPos = e} - -- XXX: this name is not good toSym :: Bool -> A.FuncParam -> Sym -toSym ref (a, b, c, d) = newSym a b c ref d +toSym ref (a, b, c, d) = Sym a b c ref d type SymMap = Map.Map A.Ident Sym -- cgit v1.2.3