comparison src/prepare.sml @ 1073:b2311dfb3158

Initializers and setval
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Dec 2009 14:20:41 -0500
parents 217eb87dde31
children 0657e5adc938
comparison
equal deleted inserted replaced
1072:9001966ae1c8 1073:b2311dfb3158
271 ((ENextval {seq = seq, prepared = SOME {id = id, query = s}}, loc), st) 271 ((ENextval {seq = seq, prepared = SOME {id = id, query = s}}, loc), st)
272 end 272 end
273 else 273 else
274 (e, st) 274 (e, st)
275 275
276 | ESetval {seq = e1, count = e2} =>
277 let
278 val (e1, st) = prepExp (e1, st)
279 val (e2, st) = prepExp (e2, st)
280 in
281 ((ESetval {seq = e1, count = e2}, loc), st)
282 end
283
276 | EUnurlify (e, t) => 284 | EUnurlify (e, t) =>
277 let 285 let
278 val (e, st) = prepExp (e, st) 286 val (e, st) = prepExp (e, st)
279 in 287 in
280 ((EUnurlify (e, t), loc), st) 288 ((EUnurlify (e, t), loc), st)
315 | DDatabase _ => (d, st) 323 | DDatabase _ => (d, st)
316 | DPreparedStatements _ => (d, st) 324 | DPreparedStatements _ => (d, st)
317 | DJavaScript _ => (d, st) 325 | DJavaScript _ => (d, st)
318 | DCookie _ => (d, st) 326 | DCookie _ => (d, st)
319 | DStyle _ => (d, st) 327 | DStyle _ => (d, st)
328 | DInitializer e =>
329 let
330 val (e, st) = prepExp (e, st)
331 in
332 ((DInitializer e, loc), st)
333 end
320 334
321 fun prepare (ds, ps) = 335 fun prepare (ds, ps) =
322 let 336 let
323 val (ds, st) = ListUtil.foldlMap prepDecl St.empty ds 337 val (ds, st) = ListUtil.foldlMap prepDecl St.empty ds
324 in 338 in