summaryrefslogtreecommitdiff
path: root/src/elab_env.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-06-03 13:04:37 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-06-03 13:04:37 -0400
commitb1d29df128dd1fa879e24f0eb3f5cdc1b74e16b7 (patch)
tree370066a96da7c7aff61371c96f82804cde02fa75 /src/elab_env.sml
parentccc3c126378aaa53765f8d69c267c6ffee666acf (diff)
Some serious bug-fix work to get HTML example to compile; this includes fixing a bug with 'val' patterns in Unnest and the need for more local reduction in Especialize
Diffstat (limited to 'src/elab_env.sml')
-rw-r--r--src/elab_env.sml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/elab_env.sml b/src/elab_env.sml
index dd050c9e..bb34c345 100644
--- a/src/elab_env.sml
+++ b/src/elab_env.sml
@@ -1512,6 +1512,15 @@ 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, _) =
+ case p of
+ PWild => 0
+ | PVar _ => 1
+ | PPrim _ => 0
+ | PCon (_, _, _, NONE) => 0
+ | PCon (_, _, _, SOME p) => patBindsN p
+ | PRecord xps => foldl (fn ((_, p, _), n) => patBindsN p + n) 0 xps
+
fun edeclBinds env (d, loc) =
case d of
EDVal (p, _, _) => patBinds env p