summaryrefslogtreecommitdiff
path: root/src/core_env.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-03-08 20:34:21 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-03-08 20:34:21 -0400
commit2b9a7afa2abf672396d5ee38d9301f88b9a06dff (patch)
tree8c31380919fec41eaf59c882a30eec7106838f6c /src/core_env.sml
parentd8d9309a0242408460488de0c44029d74c7b3113 (diff)
Conversion of functions to CPS, to facilitate ServerCall
Diffstat (limited to 'src/core_env.sml')
-rw-r--r--src/core_env.sml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core_env.sml b/src/core_env.sml
index 2c100aa5..dd77e3fb 100644
--- a/src/core_env.sml
+++ b/src/core_env.sml
@@ -342,4 +342,13 @@ fun patBinds env (p, loc) =
| PCon (_, _, _, SOME p) => patBinds env p
| PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps
+fun patBindsN (p, loc) =
+ case p of
+ PWild => 0
+ | PVar _ => 1
+ | PPrim _ => 0
+ | PCon (_, _, _, NONE) => 0
+ | PCon (_, _, _, SOME p) => patBindsN p
+ | PRecord xps => foldl (fn ((_, p, _), count) => count + patBindsN p) 0 xps
+
end