summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/GF/Main.hs')
-rw-r--r--src/compiler/GF/Main.hs22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/compiler/GF/Main.hs b/src/compiler/GF/Main.hs
index 1679c376c..642ddf565 100644
--- a/src/compiler/GF/Main.hs
+++ b/src/compiler/GF/Main.hs
@@ -1,7 +1,11 @@
-- | GF main program (grammar compiler, interactive shell, http server)
+{-# LANGUAGE CPP #-}
module GF.Main where
import GF.Compiler
-import GF.Interactive
+import qualified GF.Interactive as GFI1
+#ifdef C_RUNTIME
+import qualified GF.Interactive2 as GFI2
+#endif
import GF.Data.ErrM
import GF.Infra.Option
import GF.Infra.UseIO
@@ -43,7 +47,17 @@ mainOpts opts files =
case flag optMode opts of
ModeVersion -> putStrLn $ "Grammatical Framework (GF) version " ++ showVersion version ++ "\n" ++ buildInfo
ModeHelp -> putStrLn helpMessage
- ModeInteractive -> mainGFI opts files
- ModeRun -> mainRunGFI opts files
- ModeServer port -> mainServerGFI opts port files
+ ModeServer port -> GFI1.mainServerGFI opts port files
ModeCompiler -> mainGFC opts files
+ ModeInteractive -> GFI1.mainGFI opts files
+ ModeRun -> GFI1.mainRunGFI opts files
+#ifdef C_RUNTIME
+ ModeInteractive2 -> GFI2.mainGFI opts files
+ ModeRun2 -> GFI2.mainRunGFI opts files
+#else
+ ModeInteractive2 -> noCruntime
+ ModeRun2 -> noCruntime
+ where
+ noCruntime = do ePutStrLn "GF configured without C run-time support"
+ exitFailure
+#endif