diff options
| author | herbelin | 2013-05-05 22:47:35 +0000 |
|---|---|---|
| committer | herbelin | 2013-05-05 22:47:35 +0000 |
| commit | df313cefbaddb57f89650171e59e3abcb168a273 (patch) | |
| tree | d454b60baf938da9a3c2a59e70fc474750057b0f /interp/constrextern.ml | |
| parent | 9b67b88dc13cbd0720cf88e105a60732f8ab619b (diff) | |
Now printing body of abbreviations (i.e. notation with a name) with
full usage of notations instead of the previous cheap way to prevent
circularity in printing by deactivating all notations.
(Since "->" became a notation, printing abbreviations without
notations at all had become even more inconvenient).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16470 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp/constrextern.ml')
| -rw-r--r-- | interp/constrextern.ml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/interp/constrextern.ml b/interp/constrextern.ml index 84baefe615..7ba8617048 100644 --- a/interp/constrextern.ml +++ b/interp/constrextern.ml @@ -61,9 +61,12 @@ let print_coercions = ref false (* This forces printing universe names of Type{.} *) let print_universes = Detyping.print_universes -(* This suppresses printing of primitive tokens (e.g. numeral) and symbols *) +(* This suppresses printing of primitive tokens (e.g. numeral) and notations *) let print_no_symbol = ref false +(* This tells which notations still not to used if print_no_symbol is true *) +let print_non_active_notations = ref ([] : interp_rule list) + (* This governs printing of projections using the dot notation symbols *) let print_projections = ref false @@ -73,8 +76,10 @@ let with_arguments f = Flags.with_option print_arguments f let with_implicits f = Flags.with_option print_implicits f let with_coercions f = Flags.with_option print_coercions f let with_universes f = Flags.with_option print_universes f -let without_symbols f = Flags.with_option print_no_symbol f let with_meta_as_hole f = Flags.with_option print_meta_as_hole f +let without_symbols f = Flags.with_option print_no_symbol f +let without_specific_symbols l f = + Flags.with_extra_values print_non_active_notations l f (**********************************************************************) (* Control printing of records *) @@ -374,6 +379,7 @@ and extern_symbol_pattern (tmp_scope,scopes as allscopes) vars t = function | [] -> raise No_match | (keyrule,pat,n as _rule)::rules -> try + if List.mem keyrule !print_non_active_notations then raise No_match; match t with | PatCstr (loc,cstr,_,na) -> let p = apply_notation_to_pattern loc (ConstructRef cstr) @@ -388,6 +394,7 @@ let rec extern_symbol_ind_pattern allscopes vars ind args = function | [] -> raise No_match | (keyrule,pat,n as _rule)::rules -> try + if List.mem keyrule !print_non_active_notations then raise No_match; apply_notation_to_pattern Loc.ghost (IndRef ind) (match_notation_constr_ind_pattern ind args pat) allscopes vars keyrule with @@ -802,6 +809,7 @@ and extern_symbol (tmp_scope,scopes as allscopes) vars t = function | (keyrule,pat,n as _rule)::rules -> let loc = Glob_ops.loc_of_glob_constr t in try + if List.mem keyrule !print_non_active_notations then raise No_match; (* Adjusts to the number of arguments expected by the notation *) let (t,args,argsscopes,argsimpls) = match t,n with | GApp (_,f,args), Some n |
