summaryrefslogtreecommitdiff
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-11 19:20:37 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-11 19:20:37 -0500
commit1c1a33420c69bd2c75aa9986830020869e983e6e (patch)
tree99c1c46f59df9c378621aa8d05b072d50a81698e /src/reduce.sml
parent1d3089850988710149c0fd8d4a72aa3339e6caca (diff)
Add CutMulti
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index 1404b598..e480dea2 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -133,6 +133,19 @@ fun exp env e =
in
#1 (reduceExp env (ERecord (fields (xts, [])), loc))
end
+ | ECutMulti (r as (_, loc), _, {rest = (CRecord (k, xts), _), ...}) =>
+ 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 (fields (xts, [])), loc))
+ end
| _ => e
in