2Module : IRTS.CodegenJavaScript
3Description : The JavaScript code generator.
6Maintainer : The Idris Community.
8{-# LANGUAGE OverloadedStrings, PatternGuards #-}
9module IRTS.CodegenJavaScript (codegenJavaScript
15import Data.Text (Text)
16import qualified Data.Text as T
17import IRTS.CodegenCommon
18import IRTS.JavaScript.Codegen
19import System.Directory
23data JSTarget = Node | JavaScript deriving Eq
30 , " <meta charset='utf-8'>\n"
33 , " <script type='text/javascript'>\n"
38 T.concat [ "\n </script>\n"
43codegenJavaScript :: CodeGenerator
45 let (h, f) = if (map toLower $ takeExtension $ outputFile ci) == ".html" then
46 (htmlHeader, htmlFooter)
48 in codegenJs (CGConf { header = h
50 , jsbnPath = "jsbn/jsbn-browser.js"
51 , extraRunTime = "Runtime-javascript.js"
56codegenNode :: CodeGenerator
59 codegenJs (CGConf { header = ""
61 , jsbnPath = "jsbn/jsbn-browser.js"
62 , extraRunTime = "Runtime-node.js"
68 codegenJs (CGConf { header = "#!/usr/bin/env node\n"
70 , jsbnPath = "jsbn/jsbn-browser.js"
71 , extraRunTime = "Runtime-node.js"
75 setPermissions (outputFile ci) (emptyPermissions { readable = True
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