11import System.Environment
19data Opts = Opts { inputs :: [FilePath],
23showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
24 putStrLn "Usage: idris-codegen-c <ibc-files> [-o <output-file>]"
28getOpts = do xs <- getArgs
29 return $ process (Opts [] False "a.out") xs
31 process opts ("-o":o:xs) = process (opts { output = o }) xs
32 process opts ("--interface":xs) = process (opts { interface = True }) xs
33 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
34 process opts [] = opts
36c_main :: Opts -> Idris ()
37c_main opts = do runIO setupBundledCC
39 loadInputs (inputs opts) Nothing
40 mainProg <- if interface opts
41 then liftM Just elabMain
43 ir <- compile (Via IBCFormat "c") (output opts) mainProg
47main = do opts <- getOpts
48 if (null (inputs opts))
50 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