aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2016-04-10 14:32:50 +0200
committerHugo Herbelin2016-04-27 21:55:45 +0200
commit9e9620b99f68622ebaf44c43e9945580f6cc6d98 (patch)
treeaa3c05f348b7520ccfe407db1301788a55f58673
parent973b6c69f0861c113f7bd5b94604d2497520a334 (diff)
So as to beautify to work, do not use notations in Inductive types
with a clause where, nor Notation, nor Fixpoints. Should be certainly improved at least for Inductive types and Fixpoints, depending on whether there is a "where" clause for instance.
-rw-r--r--printing/ppvernac.ml11
1 files changed, 7 insertions, 4 deletions
diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml
index f0548238a7..0e68c961f5 100644
--- a/printing/ppvernac.ml
+++ b/printing/ppvernac.ml
@@ -259,7 +259,8 @@ module Make
| _ as c -> brk(0,2) ++ str" :" ++ pr_c c
let pr_decl_notation prc ((loc,ntn),c,scopt) =
- fnl () ++ keyword "where " ++ qs ntn ++ str " := " ++ prc c ++
+ fnl () ++ keyword "where " ++ qs ntn ++ str " := "
+ ++ Flags.without_option Flags.beautify_file prc c ++
pr_opt (fun sc -> str ": " ++ str sc) scopt
let pr_binders_arg =
@@ -674,7 +675,7 @@ module Make
in
return (
hov 2 (keyword "Notation" ++ spc() ++ ps ++
- str " :=" ++ pr_constrarg c ++ pr_syntax_modifiers l ++
+ str " :=" ++ Flags.without_option Flags.beautify_file pr_constrarg c ++ pr_syntax_modifiers l ++
(match opt with
| None -> mt()
| Some sc -> str" :" ++ spc() ++ str sc))
@@ -756,7 +757,7 @@ module Make
let pr_constructor (coe,(id,c)) =
hov 2 (pr_lident id ++ str" " ++
(if coe then str":>" else str":") ++
- pr_spc_lconstr c)
+ Flags.without_option Flags.beautify_file pr_spc_lconstr c)
in
let pr_constructor_list b l = match l with
| Constructors [] -> mt()
@@ -794,12 +795,14 @@ module Make
| Some Local -> "Local "
| None | Some Global -> ""
in
+ let pr_pure_lconstr c =
+ Flags.without_option Flags.beautify_file pr_lconstr c in
let pr_onerec = function
| (((loc,id),pl),ro,bl,type_,def),ntn ->
let annot = pr_guard_annot pr_lconstr_expr bl ro in
pr_id id ++ pr_univs pl ++ pr_binders_arg bl ++ annot
++ pr_type_option (fun c -> spc() ++ pr_lconstr_expr c) type_
- ++ pr_opt (fun def -> str":=" ++ brk(1,2) ++ pr_lconstr def) def ++
+ ++ pr_opt (fun def -> str":=" ++ brk(1,2) ++ pr_pure_lconstr def) def ++
prlist (pr_decl_notation pr_constr) ntn
in
return (