From de6e0fdd9f3078b9b0ccf87ba8a7dcc9cc47c9aa Mon Sep 17 00:00:00 2001 From: herbelin Date: Thu, 10 May 2007 15:31:46 +0000 Subject: Prise en compte réversibilité des notations de la forme "Notation Nil := @nil". Ajout @ref au niveau constr pour allègement syntaxe. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9819 85f007b7-540e-0410-9357-904b9bb8a0f7 --- interp/constrextern.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'interp/constrextern.ml') diff --git a/interp/constrextern.ml b/interp/constrextern.ml index 771a0b299d..cf4d2db0e4 100644 --- a/interp/constrextern.ml +++ b/interp/constrextern.ml @@ -834,10 +834,13 @@ and extern_symbol (tmp_scope,scopes as allscopes) vars t = function try (* Adjusts to the number of arguments expected by the notation *) let (t,args) = match t,n with - | RApp (_,f,args), Some n when List.length args > n -> + | RApp (_,(RRef _ as f),args), Some n when List.length args >= n -> let args1, args2 = list_chop n args in (if n = 0 then f else RApp (dummy_loc,f,args1)), args2 - | _ -> t,[] in + | RApp (_,(RRef _ as f),args), None -> f, args + | RRef _, Some 0 -> RApp (dummy_loc,t,[]), [] + | _, None -> t,[] + | _ -> raise No_match in (* Try matching ... *) let subst = match_aconstr t pat in (* Try availability of interpretation ... *) -- cgit v1.2.3