Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from cartazio/patch-1

compatibility with both 7.6 and 7.4
  • Loading branch information...
commit d001a5910eec295e6c8c331b2b150900b362ef5e 2 parents 3273ab2 + 8debae1
@edwinb authored
Showing with 17 additions and 3 deletions.
  1. +3 −1 Epic/CodegenC.lhs
  2. +14 −2 Epic/Language.lhs
View
4 Epic/CodegenC.lhs
@@ -1,3 +1,4 @@
+> {-#LANGUAGE FlexibleContexts#-}
> module Epic.CodegenC where
> import Control.Monad.State
@@ -98,10 +99,11 @@
> if (x>max) then put x else return ()
> cgs [] = return ""
+
> cgs (x:xs) = do xc <- cg x
> xsc <- cgs xs
> return $ xc ++ "\n" ++ xsc
-
+> cg:: (MonadState Int m) => ByteOp -> m [Char]
> cg (CALL t fn args) = return $ tmp t ++ " = " ++ quickcall fn ++
> targs "(" args ++ ");"
> cg (TAILCALL t fn args)
View
16 Epic/Language.lhs
@@ -1,9 +1,14 @@
-> {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses,
+> {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses,CPP,
> FunctionalDependencies #-}
> module Epic.Language where
> import Control.Monad
+#if MIN_VERSION_base(4,6,0)
+> import Control.Exception.Base
+#endif
+
+
> import System.IO
> import System.Directory
> import System.Environment
@@ -379,7 +384,14 @@ Temp files for compiler output
> environment :: String -> IO (Maybe String)
> environment x = catch (do e <- getEnv x
> return (Just e))
-> (\_ -> return Nothing)
+#if MIN_VERSION_base(4,6,0)
+> (\y-> do return (y::SomeException); return Nothing)
+#endif
+>
+#if !MIN_VERSION_base(4,6,0)
+> (\_-> return Nothing)
+#endif
+
Some tests
Please sign in to comment.
Something went wrong with that request. Please try again.