Mercurial > urweb
diff src/reduce.sml @ 339:075b36dbb1a4
Crud supports INSERT
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 14 Sep 2008 15:10:04 -0400 |
parents | f307cdd08d81 |
children | e0e9e9eca1cb |
line wrap: on
line diff
--- a/src/reduce.sml Sun Sep 14 11:02:18 2008 -0400 +++ b/src/reduce.sml Sun Sep 14 15:10:04 2008 -0400 @@ -130,6 +130,19 @@ | _ => false) xes of SOME (_, e, _) => #1 e | NONE => e) + | EWith (r as (_, loc), x, e, {rest = (CRecord (k, xts), _), field}) => + let + fun fields (remaining, passed) = + case remaining of + [] => [] + | (x, t) :: rest => + (x, + (EField (r, x, {field = t, + rest = (CRecord (k, List.revAppend (passed, rest)), loc)}), loc), + t) :: fields (rest, (x, t) :: passed) + in + #1 (reduceExp env (ERecord ((x, e, field) :: fields (xts, [])), loc)) + end | ECut (r as (_, loc), _, {rest = (CRecord (k, xts), _), ...}) => let fun fields (remaining, passed) =