15import System.Environment
20data Opts = Opts { inputs :: [FilePath],
24showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
25 putStrLn "Usage: idris-codegen-c <ibc-files> [-o <output-file>]"
29getOpts = do xs <- getArgs
30 return $ process (Opts [] False "a.out") xs
32 process opts ("-o":o:xs) = process (opts { output = o }) xs
33 process opts ("--interface":xs) = process (opts { interface = True }) xs
34 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
35 process opts [] = opts
37c_main :: Opts -> Idris ()
38c_main opts = do runIO setupBundledCC
40 loadInputs (inputs opts) Nothing
41 mainProg <- if interface opts
42 then liftM Just elabMain
44 ir <- compile (Via IBCFormat "c") (output opts) mainProg
48main = do opts <- getOpts
49 if (null (inputs opts))
51 else runMain (c_main opts)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list