7import IRTS.CodegenJavaScript
10import System.Environment
13data Opts = Opts { inputs :: [FilePath]
17showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
18 putStrLn "Usage: idris-codegen-node <ibc-files> [-o <output-file>]"
22getOpts = do xs <- getArgs
23 return $ process (Opts [] "main.js") xs
25 process opts ("-o":o:xs) = process (opts { output = o }) xs
26 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
27 process opts [] = opts
29jsMain :: Opts -> Idris ()
30jsMain opts = do elabPrims
31 loadInputs (inputs opts) Nothing
33 ir <- compile (Via IBCFormat "node") (output opts) (Just mainProg)
34 runIO $ codegenNode ir
37main = do opts <- getOpts
38 if (null (inputs opts))
40 else runMain (jsMain 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