aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib/interface
diff options
context:
space:
mode:
authorGravatar bertot <bertot@85f007b7-540e-0410-9357-904b9bb8a0f7>2004-01-22 11:32:18 +0000
committerGravatar bertot <bertot@85f007b7-540e-0410-9357-904b9bb8a0f7>2004-01-22 11:32:18 +0000
commite537a3deafdb8d2d4cebbcb592add25b93972540 (patch)
tree7c086ab526f19bf7f0f24c1f12e5aae59d92bb79 /contrib/interface
parentaa9fb2fb35ee0b1a409a72135ba60086bef625bd (diff)
corrects the way the structural argument declaration is handled in
fixpoint definitions git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5234 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'contrib/interface')
-rw-r--r--contrib/interface/xlate.ml9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/interface/xlate.ml b/contrib/interface/xlate.ml
index aae7d714f..9c91d930e 100644
--- a/contrib/interface/xlate.ml
+++ b/contrib/interface/xlate.ml
@@ -292,10 +292,15 @@ let rec decompose_last = function
| a::tl -> let rl, b = decompose_last tl in (a::rl), b;;
let rec make_fix_struct b = function
- 0, CProdN(_, [([na],_)], CProdN(_, _,_)) -> xlate_id_opt na
+ 0, CProdN(_, [(na::tl,_)], CProdN(_, _,_)) -> xlate_id_opt na
| 0, CProdN(_, [([na],_)], _) ->
if b then xlate_id_opt na else ctv_ID_OPT_NONE
- | n, CProdN(_, [([_],_)],body) -> make_fix_struct true ((n-1),body)
+ | n, CProdN(_, [(l,_)],body) ->
+ let len = List.length l in
+ if len <= n then
+ make_fix_struct true (n-len, body)
+ else
+ xlate_id_opt(List.nth l n)
| _, _ -> xlate_error "unexpected result of parsing for Fixpoint";;