diff options
| author | Pierre-Marie Pédrot | 2016-09-14 11:40:15 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2016-09-14 11:40:15 +0200 |
| commit | 5e4dc9a1896a1dff832089be20cd43f4f4776869 (patch) | |
| tree | f8661480501f26b7d3dd46e064c1a6084991a280 /printing | |
| parent | 93a03345830047310d975d5de3742fa58a0a224b (diff) | |
| parent | 3e794be5f02ed438cdc5a351d09bdfb54c0be01a (diff) | |
Merge branch 'v8.6'
Diffstat (limited to 'printing')
| -rw-r--r-- | printing/pptactic.ml | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/printing/pptactic.ml b/printing/pptactic.ml index 917a277c91..e2c78a5075 100644 --- a/printing/pptactic.ml +++ b/printing/pptactic.ml @@ -373,20 +373,25 @@ module Make in str "<" ++ name ++ str ">" ++ args + let rec pr_user_symbol = function + | Extend.Ulist1 tkn -> "ne_" ^ pr_user_symbol tkn ^ "_list" + | Extend.Ulist1sep (tkn, _) -> "ne_" ^ pr_user_symbol tkn ^ "_list" + | Extend.Ulist0 tkn -> pr_user_symbol tkn ^ "_list" + | Extend.Ulist0sep (tkn, _) -> pr_user_symbol tkn ^ "_list" + | Extend.Uopt tkn -> pr_user_symbol tkn ^ "_opt" + | Extend.Uentry tag -> + let ArgT.Any tag = tag in + ArgT.repr tag + | Extend.Uentryl (tkn, lvl) -> "tactic" ^ string_of_int lvl + let pr_alias_key key = try let prods = (KNmap.find key !prnotation_tab).pptac_prods in - (* First printing strategy: only the head symbol *) - match prods with - | TacTerm s :: prods -> str s - | _ -> - (* Second printing strategy; if ever Tactic Notation is eventually *) - (* accepting notations not starting with an identifier *) let rec pr = function - | [] -> [] - | TacTerm s :: prods -> s :: pr prods - | TacNonTerm (_,_,id) :: prods -> ".." :: pr prods in - str (String.concat " " (pr prods)) + | TacTerm s -> primitive s + | TacNonTerm (_, symb, _) -> str (Printf.sprintf "(%s)" (pr_user_symbol symb)) + in + pr_sequence pr prods with Not_found -> KerName.print key |
