packages feed

copilot-c99 3.0.2 → 3.1

raw patch · 5 files changed

+13/−7 lines, 5 filesdep ~copilot-corenew-uploaderPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: copilot-core

API changes (from Hackage documentation)

Files

+ CHANGELOG view
@@ -0,0 +1,5 @@+2019-11-22 Ivan Perez <ivan.perez@nianet.org>+        * Version bump (3.1).+        * Remove ExternFun (#6).+        * Fix bug in code generation for local expression (#15).+        * Implement code generation for labels (trivially) (#14).
copilot-c99.cabal view
@@ -1,6 +1,6 @@ cabal-version             : >= 1.10 name                      : copilot-c99-version                   : 3.0.2+version                   : 3.1 synopsis                  : A compiler for Copilot targeting C99. description               :   This package is a back-end from Copilot to C.@@ -21,6 +21,7 @@ category                  : Language, Embedded build-type                : Simple extra-source-files        : README.md+                          , CHANGELOG  author                    : Frank Dedden                           , Alwyn Goodloe@@ -40,7 +41,7 @@                           , mtl                 >= 2.2 && < 2.3                           , pretty              >= 1.1 && < 1.2 -                          , copilot-core        >= 3.0.1 && < 3.1+                          , copilot-core        >= 3.1   && < 3.2                           , language-c99        >= 0.1.1 && < 0.2                           , language-c99-util   >= 0.1.1 && < 0.2                           , language-c99-simple >= 0.1.1 && < 0.2
src/Copilot/Compile/C99/CodeGen.hs view
@@ -137,6 +137,7 @@   Op1 _ e1              -> exprtypes e1   Op2 _ e1 e2           -> exprtypes e1 `union` exprtypes e2   Op3 _ e1 e2 e3        -> exprtypes e1 `union` exprtypes e2 `union` exprtypes e3+  Label ty _ _          -> typetypes ty  -- | List all types of an type, returns items uniquely. typetypes :: Typeable a => Type a -> [UType]
src/Copilot/Compile/C99/External.hs view
@@ -42,4 +42,5 @@     Op1 _ e             -> rec e     Op2 _ e1 e2         -> rec e1 `extunion` rec e2     Op3 _ e1 e2 e3      -> rec e1 `extunion` rec e2 `extunion` rec e3+    Label _ _ e         -> rec e     _                   -> []
src/Copilot/Compile/C99/Translate.hs view
@@ -15,12 +15,12 @@  transexpr (Local ty1 _ name e1 e2) = do   e1' <- transexpr e1-  e2' <- transexpr e2   let cty1 = transtype ty1       init = Just $ C.InitExpr e1'   statetell ([C.VarDecln Nothing cty1 name init], [])-  return $ e2' +  transexpr e2+ transexpr (Var _ n) = return $ C.Ident n  transexpr (Drop _ amount sid) = do@@ -33,9 +33,7 @@  transexpr (ExternVar _ name _) = return $ C.Ident (excpyname name) -transexpr (ExternFun _ _ _ _ _) = undefined--transexpr (Label _ _ _) = undefined+transexpr (Label _ _ e) = transexpr e -- ignore label  transexpr (Op1 op e) = do   e' <- transexpr e