summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Artyom Shalkhakov <artyom.shalkhakov@gmail.com>2017-03-07 13:47:55 +0000
committerGravatar Artyom Shalkhakov <artyom.shalkhakov@gmail.com>2017-03-07 13:47:55 +0000
commitbfc7faaf3b8cdff7ca6baec6b3358aef531eb9e2 (patch)
treef0b93d51b82fc11f75bdeb2ae991b74c057d74c8 /src/cjr_print.sml
parent5c7051419520ca3449649dbfc68e755b45cde0f1 (diff)
Adding support for emitting JS to a given file.
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index 688b3e4d..53587ff7 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -2513,8 +2513,12 @@ fun p_decl env (dAll as (d, loc) : decl) =
| DJavaScript s =>
let
+ val name =
+ (case Settings.getOutputJsFile () of
+ NONE => "app." ^ SHA1.bintohex (SHA1.hash s) ^ ".js"
+ | SOME s => s)
val () = app_js := OS.Path.joinDirFile {dir = Settings.getUrlPrefix (),
- file = "app." ^ SHA1.bintohex (SHA1.hash s) ^ ".js"}
+ file = name}
in
box [string "static char jslib[] = \"",
string (Prim.toCString s),