summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-07-31 09:56:41 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2014-07-31 09:56:41 -0400
commit3154131cddb8bc8fe76b86bd9f4902f1d531bce6 (patch)
tree94c286505de9c26af97dc420ae0c4c6aa11fd21b /src/compiler.sml
parent08bbe52588b9d195295f1b5aca14c88a9ae3ea3c (diff)
New .urp directive: file
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 269a7824..2190684a 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -461,6 +461,8 @@ fun parseUrp' accLibs fname =
end
else
let
+ val thisPath = OS.Path.dir fname
+
val pathmap = ref (!pathmap)
val bigLibs = ref []
@@ -876,6 +878,13 @@ fun parseUrp' accLibs fname =
| "html5" => Settings.setIsHtml5 true
| "lessSafeFfi" => Settings.setLessSafeFfi true
+ | "file" =>
+ (case String.fields Char.isSpace arg of
+ [uri, fname] => (Settings.setFilePath thisPath;
+ Settings.addFile {Uri = uri,
+ LoadFromFilename = fname})
+ | _ => ErrorMsg.error "Bad 'file' arguments")
+
| _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'");
read ()
end