comparison src/cjr_print.sml @ 1932:98895243b5b6

Change handling of returned text blobs, to activate the normal EWrite optimizations
author Adam Chlipala <adam@chlipala.net>
date Wed, 11 Dec 2013 18:22:10 -0500
parents 1a04b1edded2
children fda9d5af69e7
comparison
equal deleted inserted replaced
1931:1a04b1edded2 1932:98895243b5b6
1626 string ");", 1626 string ");",
1627 newline, 1627 newline,
1628 string "tmp;", 1628 string "tmp;",
1629 newline, 1629 newline,
1630 string "})"] 1630 string "})"]
1631 | EReturnBlob {blob, mimeType, t} => 1631 | EReturnBlob {blob = SOME blob, mimeType, t} =>
1632 box [string "({", 1632 box [string "({",
1633 newline, 1633 newline,
1634 string "uw_Basis_blob", 1634 string "uw_Basis_blob",
1635 space, 1635 space,
1636 string "blob", 1636 string "blob",
1652 p_typ env t, 1652 p_typ env t,
1653 space, 1653 space,
1654 string "tmp;", 1654 string "tmp;",
1655 newline, 1655 newline,
1656 string "uw_return_blob(ctx, blob, mimeType);", 1656 string "uw_return_blob(ctx, blob, mimeType);",
1657 newline,
1658 string "tmp;",
1659 newline,
1660 string "})"]
1661 | EReturnBlob {blob = NONE, mimeType, t} =>
1662 box [string "({",
1663 newline,
1664 string "uw_Basis_string",
1665 space,
1666 string "mimeType",
1667 space,
1668 string "=",
1669 space,
1670 p_exp' false false env mimeType,
1671 string ";",
1672 newline,
1673 p_typ env t,
1674 space,
1675 string "tmp;",
1676 newline,
1677 string "uw_return_blob_from_page(ctx, mimeType);",
1657 newline, 1678 newline,
1658 string "tmp;", 1679 string "tmp;",
1659 newline, 1680 newline,
1660 string "})"] 1681 string "})"]
1661 | ERedirect (e, t) => 1682 | ERedirect (e, t) =>
3178 | EBinop (_, e1, e2) => expDb e1 orelse expDb e2 3199 | EBinop (_, e1, e2) => expDb e1 orelse expDb e2
3179 | ERecord (_, xes) => List.exists (expDb o #2) xes 3200 | ERecord (_, xes) => List.exists (expDb o #2) xes
3180 | EField (e, _) => expDb e 3201 | EField (e, _) => expDb e
3181 | ECase (e, pes, _) => expDb e orelse List.exists (expDb o #2) pes 3202 | ECase (e, pes, _) => expDb e orelse List.exists (expDb o #2) pes
3182 | EError (e, _) => expDb e 3203 | EError (e, _) => expDb e
3183 | EReturnBlob {blob = e1, mimeType = e2, ...} => expDb e1 orelse expDb e2 3204 | EReturnBlob {blob = NONE, mimeType = e2, ...} => expDb e2
3205 | EReturnBlob {blob = SOME e1, mimeType = e2, ...} => expDb e1 orelse expDb e2
3184 | ERedirect (e, _) => expDb e 3206 | ERedirect (e, _) => expDb e
3185 | EWrite e => expDb e 3207 | EWrite e => expDb e
3186 | ESeq (e1, e2) => expDb e1 orelse expDb e2 3208 | ESeq (e1, e2) => expDb e1 orelse expDb e2
3187 | ELet (_, _, e1, e2) => expDb e1 orelse expDb e2 3209 | ELet (_, _, e1, e2) => expDb e1 orelse expDb e2
3188 | EQuery _ => true 3210 | EQuery _ => true