summaryrefslogtreecommitdiff
path: root/transfer/transferc.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-26 21:05:01 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-26 21:05:01 +0000
commitfb1d9b7d2c3c8261fc5a2ce3698e6749458b207a (patch)
tree466adc81f2c6ac803d20804863927c076e2b243a /transfer/transferc.hs
parent33eb6d899fef48f2d38a92bc0fab66ff585be553 (diff)
removed transfer from gf3
Diffstat (limited to 'transfer/transferc.hs')
-rw-r--r--transfer/transferc.hs39
1 files changed, 0 insertions, 39 deletions
diff --git a/transfer/transferc.hs b/transfer/transferc.hs
deleted file mode 100644
index 7a88d8e3a..000000000
--- a/transfer/transferc.hs
+++ /dev/null
@@ -1,39 +0,0 @@
-module Main where
-
-import Transfer.CompilerAPI
-
-import Data.List (partition, isPrefixOf)
-import System.Environment
-import System.Exit
-import System.IO
-
-die :: String -> IO a
-die s = do
- hPutStrLn stderr s
- exitFailure
-
-getPath :: IO [String]
-getPath = do env <- getEnvironment
- return $ case lookup "TRANSFER_PATH" env of
- Nothing -> []
- Just p -> splitBy (==':') p
-
--- Modified version of a function which is originally
--- Copyright Bryn Keller
-splitBy :: (a -> Bool) -> [a] -> [[a]]
-splitBy _ [] = []
-splitBy f list = first : splitBy f (dropWhile f rest)
- where (first, rest) = break f list
-
-main :: IO ()
-main = do
- args <- getArgs
- let (flags,files) = partition ("-" `isPrefixOf`) args
- argPath = [ p | ('-':'i':p) <- flags ]
- envPath <- getPath
- case files of
- [f] -> do
- cf <- compileFile (argPath ++ envPath) f
- putStrLn $ "Wrote " ++ cf
- return ()
- _ -> die "Usage: transferc [-i<path> [-i<path> ... ]] <file>"