diff src/cjr_print.sml @ 741:f7e2026dd5ae

Returning a blob as page result
author Adam Chlipala <adamc@hcoop.net>
date Sun, 26 Apr 2009 09:02:17 -0400
parents 4bb7e1c0550a
children 43553c93dd8c
line wrap: on
line diff
--- a/src/cjr_print.sml	Sat Apr 25 14:47:16 2009 -0400
+++ b/src/cjr_print.sml	Sun Apr 26 09:02:17 2009 -0400
@@ -1276,8 +1276,26 @@
              string "tmp;",
              newline,
              string "})"]
+      | EReturnBlob {blob, mimeType, t} =>
+        box [string "({",
+             newline,
+             p_typ env t,
+             space,
+             string "tmp;",
+             newline,
+             string "uw_return_blob(ctx, ",
+             p_exp env blob,
+             string ", ",
+             p_exp env mimeType,
+             string ");",
+             newline,
+             string "tmp;",
+             newline,
+             string "})"]
       | EApp ((EError (e, (TFun (_, ran), _)), loc), _) =>
         p_exp env (EError (e, ran), loc)
+      | EApp ((EReturnBlob {blob, mimeType, t = (TFun (_, ran), _)}, loc), _) =>
+        p_exp env (EReturnBlob {blob = blob, mimeType = mimeType, t = ran}, loc)
 
       | EFfiApp (m, x, es) => box [string "uw_",
                                    p_ident m,