summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c/urweb.c20
-rw-r--r--src/jscomp.sml2
2 files changed, 22 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 491fb73d..8ebd9a2f 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -1762,6 +1762,16 @@ char *uw_Basis_urlifyBool(uw_context ctx, uw_Basis_bool b) {
return "1";
}
+char *uw_Basis_urlifySource(uw_context ctx, uw_Basis_source src) {
+ char *r;
+ int len;
+ uw_check_heap(ctx, 2 * INTS_MAX + 2);
+ r = ctx->heap.front;
+ sprintf(r, "%d/%llu%n", src.context, src.source, &len);
+ ctx->heap.front += len+1;
+ return r;
+}
+
static void uw_Basis_urlifyInt_w_unsafe(uw_context ctx, uw_Basis_int n) {
int len;
@@ -1843,6 +1853,16 @@ uw_unit uw_Basis_urlifyBool_w(uw_context ctx, uw_Basis_bool b) {
return uw_unit_v;
}
+uw_unit uw_Basis_urlifySource_w(uw_context ctx, uw_Basis_source src) {
+ int len;
+
+ uw_check(ctx, 2 * INTS_MAX + 2);
+ sprintf(ctx->page.front, "%d/%llu%n", src.context, src.source, &len);
+ ctx->page.front += len;
+
+ return uw_unit_v;
+}
+
static char *uw_unurlify_advance(char *s) {
char *new_s = strchr(s, '/');
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 3e475899..16043ba5 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -310,6 +310,8 @@ fun process file =
| TFfi ("Basis", "bool") => ("t[i++] == \"1\"", st)
+ | TSource => ("parseSource(t[i++], t[i++])", st)
+
| TOption t =>
let
val (e, st) = unurlifyExp loc (t, st)