summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-10 15:46:07 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-10 15:46:07 -0500
commit5b89513c103be2bde3048d8310469e4a0a7d5d1d (patch)
treed477da76701c5aa53d786e821158dbc673245964
parent5902e311a458e8a6983bf3fbf7d34c78a3ad229d (diff)
Bug fixes in redirect-related stuff
-rw-r--r--src/c/urweb.c1
-rw-r--r--src/monoize.sml18
-rw-r--r--src/tag.sml4
3 files changed, 10 insertions, 13 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 154e085a..f852ddb8 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -3083,7 +3083,6 @@ __attribute__((noreturn)) void uw_redirect(uw_context ctx, uw_Basis_string url)
char *s2;
for (++s; s2 = strchr(s, '\n'); s = s2+1) {
*s2 = 0;
- printf("Line: %s\n", s);
if (!strncmp(s, "Set-Cookie: ", 12)) {
uw_write_header(ctx, s);
uw_write_header(ctx, "\n");
diff --git a/src/monoize.sml b/src/monoize.sml
index 2d1a1f33..0a1990c7 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -395,8 +395,6 @@ fun capitalize s =
else
str (Char.toUpper (String.sub (s, 0))) ^ String.extract (s, 1, NONE)
-val inTag = ref false
-
fun fooifyExp fk env =
let
fun fooify fm (e, tAll as (t, loc)) =
@@ -2480,9 +2478,6 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
tag), _),
xml) =>
let
- val inT = !inTag
- val () = inTag := true
-
fun getTag' (e, _) =
case e of
L.EFfi ("Basis", tag) => (tag, [])
@@ -2918,7 +2913,6 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
| "tabl" => normal ("table", NONE, NONE)
| _ => normal (tag, NONE, NONE))
- before inTag := inT
end
| L.EApp ((L.ECApp (
@@ -3144,6 +3138,13 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
fm)
end
+ | L.EFfiApp ("Basis", "url", [e]) =>
+ let
+ val (e, fm) = monoExp (env, st, fm) e
+ in
+ urlifyExp env fm (e, dummyTyp)
+ end
+
| L.EApp (e1, e2) =>
let
val (e1, fm) = monoExp (env, st, fm) e1
@@ -3223,10 +3224,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
fm es
val e = (L'.EClosure (n, es), loc)
in
- if !inTag then
- (e, fm)
- else
- urlifyExp env fm (e, dummyTyp)
+ (e, fm)
end
| L.ELet (x, t, e1, e2) =>
diff --git a/src/tag.sml b/src/tag.sml
index 9510d360..f1aef1ce 100644
--- a/src/tag.sml
+++ b/src/tag.sml
@@ -169,7 +169,7 @@ fun exp env (e, s) =
let
val (e, s) = tagIt (e, Link, "Url", s)
in
- (#1 e, s)
+ (EFfiApp ("Basis", "url", [e]), s)
end
| EApp ((ENamed n, _), e') =>
@@ -181,7 +181,7 @@ fun exp env (e, s) =
let
val (e, s) = tagIt (e', Link, "Url", s)
in
- (#1 e, s)
+ (EFfiApp ("Basis", "url", [e]), s)
end
| _ => (e, s)
end