comparison src/jscomp.sml @ 1025:7facf72aaf0a

Initial form for paper assignment
author Adam Chlipala <adamc@hcoop.net>
date Sun, 01 Nov 2009 14:26:20 -0500
parents 7a4a55e05081
children eaba663fd6aa
comparison
equal deleted inserted replaced
1024:93415bcf54c0 1025:7facf72aaf0a
120 :: es 120 :: es
121 @ [str loc "}"]), st) 121 @ [str loc "}"]), st)
122 end 122 end
123 123
124 | TFfi ("Basis", "string") => ((EFfiApp ("Basis", "jsifyString", [e]), loc), st) 124 | TFfi ("Basis", "string") => ((EFfiApp ("Basis", "jsifyString", [e]), loc), st)
125 | TFfi ("Basis", "char") => ((EFfiApp ("Basis", "jsifyChar", [e]), loc), st)
125 | TFfi ("Basis", "int") => ((EFfiApp ("Basis", "htmlifyInt", [e]), loc), st) 126 | TFfi ("Basis", "int") => ((EFfiApp ("Basis", "htmlifyInt", [e]), loc), st)
126 | TFfi ("Basis", "float") => ((EFfiApp ("Basis", "htmlifyFloat", [e]), loc), st) 127 | TFfi ("Basis", "float") => ((EFfiApp ("Basis", "htmlifyFloat", [e]), loc), st)
127 | TFfi ("Basis", "channel") => ((EFfiApp ("Basis", "jsifyChannel", [e]), loc), st) 128 | TFfi ("Basis", "channel") => ((EFfiApp ("Basis", "jsifyChannel", [e]), loc), st)
128 129
129 | TFfi ("Basis", "bool") => ((ECase (e, 130 | TFfi ("Basis", "bool") => ((ECase (e,
305 :: es 306 :: es
306 @ ["}"]), st) 307 @ ["}"]), st)
307 end 308 end
308 309
309 | TFfi ("Basis", "string") => ("uu(t[i++])", st) 310 | TFfi ("Basis", "string") => ("uu(t[i++])", st)
311 | TFfi ("Basis", "char") => ("uu(t[i++])", st)
310 | TFfi ("Basis", "int") => ("parseInt(t[i++])", st) 312 | TFfi ("Basis", "int") => ("parseInt(t[i++])", st)
311 | TFfi ("Basis", "float") => ("parseFloat(t[i++])", st) 313 | TFfi ("Basis", "float") => ("parseFloat(t[i++])", st)
312 | TFfi ("Basis", "channel") => ("(t[i++].length > 0 ? parseInt(t[i]) : null)", st) 314 | TFfi ("Basis", "channel") => ("(t[i++].length > 0 ? parseInt(t[i]) : null)", st)
313 315
314 | TFfi ("Basis", "bool") => ("t[i++] == \"1\"", st) 316 | TFfi ("Basis", "bool") => ("t[i++] == \"1\"", st)