summaryrefslogtreecommitdiff
path: root/src/mono_env.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-12-20 14:19:21 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-12-20 14:19:21 -0500
commita08075494d9c16a349215fbcaefa3e1d14d2e0f9 (patch)
treeb3d519edc46498c2743994fbcf548dd1a2f3e66b /src/mono_env.sml
parente478b4d432d65b33613a601f71204fc0c656c3db (diff)
Start of JsComp
Diffstat (limited to 'src/mono_env.sml')
-rw-r--r--src/mono_env.sml11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mono_env.sml b/src/mono_env.sml
index 47ffd28d..cce4a4c4 100644
--- a/src/mono_env.sml
+++ b/src/mono_env.sml
@@ -122,4 +122,15 @@ fun patBinds env (p, loc) =
| PNone _ => env
| PSome (_, p) => patBinds env p
+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
+ | PNone _ => 0
+ | PSome (_, p) => patBindsN p
+
end