comparison src/jscomp.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 796e42c93c48
children 7f653298dd66
comparison
equal deleted inserted replaced
740:b302b6e35f93 741:f7e2026dd5ae
99 | ECase (e, pes, _) => 99 | ECase (e, pes, _) =>
100 foldl Int.max (varDepth e) 100 foldl Int.max (varDepth e)
101 (map (fn (p, e) => E.patBindsN p + varDepth e) pes) 101 (map (fn (p, e) => E.patBindsN p + varDepth e) pes)
102 | EStrcat (e1, e2) => Int.max (varDepth e1, varDepth e2) 102 | EStrcat (e1, e2) => Int.max (varDepth e1, varDepth e2)
103 | EError (e, _) => varDepth e 103 | EError (e, _) => varDepth e
104 | EReturnBlob {blob = e1, mimeType = e2, ...} => Int.max (varDepth e1, varDepth e2)
104 | EWrite e => varDepth e 105 | EWrite e => varDepth e
105 | ESeq (e1, e2) => Int.max (varDepth e1, varDepth e2) 106 | ESeq (e1, e2) => Int.max (varDepth e1, varDepth e2)
106 | ELet (_, _, e1, e2) => Int.max (varDepth e1, 1 + varDepth e2) 107 | ELet (_, _, e1, e2) => Int.max (varDepth e1, 1 + varDepth e2)
107 | EClosure _ => 0 108 | EClosure _ => 0
108 | EQuery _ => 0 109 | EQuery _ => 0
139 | ECase (e, pes, _) => 140 | ECase (e, pes, _) =>
140 cu inner e 141 cu inner e
141 andalso List.all (fn (p, e) => cu (inner + E.patBindsN p) e) pes 142 andalso List.all (fn (p, e) => cu (inner + E.patBindsN p) e) pes
142 | EStrcat (e1, e2) => cu inner e1 andalso cu inner e2 143 | EStrcat (e1, e2) => cu inner e1 andalso cu inner e2
143 | EError (e, _) => cu inner e 144 | EError (e, _) => cu inner e
145 | EReturnBlob {blob = e1, mimeType = e2, ...} => cu inner e1 andalso cu inner e2
144 | EWrite e => cu inner e 146 | EWrite e => cu inner e
145 | ESeq (e1, e2) => cu inner e1 andalso cu inner e2 147 | ESeq (e1, e2) => cu inner e1 andalso cu inner e2
146 | ELet (_, _, e1, e2) => cu inner e1 andalso cu (inner + 1) e2 148 | ELet (_, _, e1, e2) => cu inner e1 andalso cu (inner + 1) e2
147 | EClosure (_, es) => List.all (cu inner) es 149 | EClosure (_, es) => List.all (cu inner) es
148 | EQuery {query, body, initial, ...} => 150 | EQuery {query, body, initial, ...} =>
913 | EClosure _ => unsupported "EClosure" 915 | EClosure _ => unsupported "EClosure"
914 | EQuery _ => unsupported "Query" 916 | EQuery _ => unsupported "Query"
915 | EDml _ => unsupported "DML" 917 | EDml _ => unsupported "DML"
916 | ENextval _ => unsupported "Nextval" 918 | ENextval _ => unsupported "Nextval"
917 | EUnurlify _ => unsupported "EUnurlify" 919 | EUnurlify _ => unsupported "EUnurlify"
920 | EReturnBlob _ => unsupported "EUnurlify"
918 | EJavaScript (_, e, _) => 921 | EJavaScript (_, e, _) =>
919 let 922 let
920 val (e, st) = jsE inner (e, st) 923 val (e, st) = jsE inner (e, st)
921 in 924 in
922 (strcat [str "cs(function(){return ", 925 (strcat [str "cs(function(){return ",