7import IRTS.CodegenJavaScript
14import System.Environment
17data Opts = Opts { inputs :: [FilePath]
22showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
23 putStrLn "Usage: idris-codegen-node <ibc-files> [-o <output-file>]"
27getOpts = do xs <- getArgs
28 return $ process (Opts [] False "main.js") xs
30 process opts ("-o":o:xs) = process (opts { output = o }) xs
31 process opts ("--interface":xs) = process (opts { interface = True }) xs
32 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
33 process opts [] = opts
35jsMain :: Opts -> Idris ()
36jsMain opts = do elabPrims
37 loadInputs (inputs opts) Nothing
38 mainProg <- if interface opts
40 else liftM Just elabMain
41 ir <- compile (Via IBCFormat "node") (output opts) mainProg
42 runIO $ codegenNode ir
45main = do opts <- getOpts
46 if (null (inputs opts))
48 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