|
@@ -9,11 +9,12 @@ import Control.Monad
|
|
import System.Console.GetOpt
|
|
import System.Console.GetOpt
|
|
import System.Environment
|
|
import System.Environment
|
|
import System.Exit
|
|
import System.Exit
|
|
|
|
+import Text.Show.Pretty
|
|
|
|
|
|
import Ivory.Artifact
|
|
import Ivory.Artifact
|
|
import Gidl.Parse
|
|
import Gidl.Parse
|
|
-import Gidl.Backend.Haskell
|
|
|
|
-import Gidl.Backend.Ivory
|
|
|
|
|
|
+--import Gidl.Backend.Haskell
|
|
|
|
+--import Gidl.Backend.Ivory
|
|
|
|
|
|
data OptParser opt = OptParser [String] (opt -> opt)
|
|
data OptParser opt = OptParser [String] (opt -> opt)
|
|
instance Monoid (OptParser opt) where
|
|
instance Monoid (OptParser opt) where
|
|
@@ -123,12 +124,17 @@ run = do
|
|
idl <- readFile (idlpath opts)
|
|
idl <- readFile (idlpath opts)
|
|
case parseDecls idl of
|
|
case parseDecls idl of
|
|
Left e -> print e >> exitFailure
|
|
Left e -> print e >> exitFailure
|
|
- Right (te, ie) ->
|
|
|
|
|
|
+ Right (te, ie) -> do
|
|
|
|
+ when (debug opts) $ do
|
|
|
|
+ putStrLn (ppShow te)
|
|
|
|
+ putStrLn (ppShow ie)
|
|
case backend opts of
|
|
case backend opts of
|
|
HaskellBackend -> artifactBackend opts $
|
|
HaskellBackend -> artifactBackend opts $
|
|
- haskellBackend te ie (packagename opts) (namespace opts)
|
|
|
|
|
|
+ []
|
|
|
|
+ --haskellBackend te ie (packagename opts) (namespace opts)
|
|
IvoryBackend -> artifactBackend opts $
|
|
IvoryBackend -> artifactBackend opts $
|
|
- ivoryBackend te ie (packagename opts) (namespace opts)
|
|
|
|
|
|
+ []
|
|
|
|
+ --ivoryBackend te ie (packagename opts) (namespace opts)
|
|
|
|
|
|
where
|
|
where
|
|
artifactBackend :: Opts -> [Artifact] -> IO ()
|
|
artifactBackend :: Opts -> [Artifact] -> IO ()
|