9import IRTS.CodegenJavaScript
11import System.Environment
21showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
22 putStrLn "Usage: idris-codegen-javascript <ibc-files> [-o <output-file>]"
26getOpts = do xs <- getArgs
27 return $ process (Opts [] "main.js") xs
29 process opts ("-o":o:xs) = process (opts { output = o }) xs
30 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
31 process opts [] = opts
33jsMain :: Opts -> Idris ()
34jsMain opts = do elabPrims
35 loadInputs (inputs opts) Nothing
37 ir <- compile (Via "javascript") (output opts) (Just mainProg)
38 runIO $ codegenJavaScript ir
41main = do opts <- getOpts
42 if (null (inputs opts))
44 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