Mercurial > urweb
comparison src/monoize.sml @ 2241:2b1af5dc6dee
Merge.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Sun, 19 Jul 2015 19:05:16 -0700 |
parents | a07b91fa71db 72fe1cc704c5 |
children | 25874084bf1f |
comparison
equal
deleted
inserted
replaced
2240:88cc0f44c940 | 2241:2b1af5dc6dee |
---|---|
2223 end | 2223 end |
2224 | L.ECApp ((L.EFfi ("Basis", "sql_option_prim"), _), t) => | 2224 | L.ECApp ((L.EFfi ("Basis", "sql_option_prim"), _), t) => |
2225 let | 2225 let |
2226 val t = monoType env t | 2226 val t = monoType env t |
2227 val s = (L'.TFfi ("Basis", "string"), loc) | 2227 val s = (L'.TFfi ("Basis", "string"), loc) |
2228 | |
2229 fun toSqlType (t : L'.typ) = | |
2230 case #1 t of | |
2231 L'.TFfi ("Basis", "int") => Settings.Int | |
2232 | L'.TFfi ("Basis", "float") => Settings.Float | |
2233 | L'.TFfi ("Basis", "string") => Settings.String | |
2234 | L'.TFfi ("Basis", "char") => Settings.Char | |
2235 | L'.TFfi ("Basis", "bool") => Settings.Bool | |
2236 | L'.TFfi ("Basis", "time") => Settings.Time | |
2237 | L'.TFfi ("Basis", "blob") => Settings.Blob | |
2238 | L'.TFfi ("Basis", "channel") => Settings.Channel | |
2239 | L'.TFfi ("Basis", "client") => Settings.Client | |
2240 | _ => raise Fail "Monoize/sql_option_prim: invalid SQL type" | |
2228 in | 2241 in |
2229 ((L'.EAbs ("f", | 2242 ((L'.EAbs ("f", |
2230 (L'.TFun (t, s), loc), | 2243 (L'.TFun (t, s), loc), |
2231 (L'.TFun ((L'.TOption t, loc), s), loc), | 2244 (L'.TFun ((L'.TOption t, loc), s), loc), |
2232 (L'.EAbs ("x", | 2245 (L'.EAbs ("x", |
2233 (L'.TOption t, loc), | 2246 (L'.TOption t, loc), |
2234 s, | 2247 s, |
2235 (L'.ECase ((L'.ERel 0, loc), | 2248 (L'.ECase ((L'.ERel 0, loc), |
2236 [((L'.PNone t, loc), | 2249 [((L'.PNone t, loc), |
2237 str "NULL"), | 2250 str (#p_cast (Settings.currentDbms ()) ("NULL", toSqlType t))), |
2238 ((L'.PSome (t, (L'.PVar ("y", t), loc)), loc), | 2251 ((L'.PSome (t, (L'.PVar ("y", t), loc)), loc), |
2239 (L'.EApp ((L'.ERel 2, loc), (L'.ERel 0, loc)), loc))], | 2252 (L'.EApp ((L'.ERel 2, loc), (L'.ERel 0, loc)), loc))], |
2240 {disc = (L'.TOption t, loc), | 2253 {disc = (L'.TOption t, loc), |
2241 result = s}), loc)), loc)), loc), | 2254 result = s}), loc)), loc)), loc), |
2242 fm) | 2255 fm) |
3411 ((L'.EStrcat (s, | 3424 ((L'.EStrcat (s, |
3412 (L'.EStrcat ( | 3425 (L'.EStrcat ( |
3413 strH s', | 3426 strH s', |
3414 (L'.EStrcat ( | 3427 (L'.EStrcat ( |
3415 (L'.EJavaScript (L'.Attribute, e), loc), | 3428 (L'.EJavaScript (L'.Attribute, e), loc), |
3416 strH ");return false'"), loc)), | 3429 strH ")'"), loc)), |
3417 loc)), loc), | 3430 loc)), loc), |
3418 fm) | 3431 fm) |
3419 end | 3432 end |
3420 | _ => | 3433 | _ => |
3421 let | 3434 let |