Skip to content

Commit

Permalink
Print alias bodies in Print Ltac2
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Oct 16, 2023
1 parent 3c8ab56 commit 94616b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/ltac2/tac2entries.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,10 @@ let print_tacref ~print_def qid = function
let data = Tac2env.interp_global kn in
let info = Option.map fst (Tac2env.get_compiled_global kn) in
print_constant ~print_def qid data ?info
| TacAlias kn -> str "Alias to ..."
| TacAlias kn ->
let { Tac2env.alias_body = body } = Tac2env.interp_alias kn in
str "Notation" ++ spc() ++ pr_qualid qid ++ str " :=" ++ spc()
++ Tac2print.pr_rawexpr_gen E5 ~avoid:Id.Set.empty body

let print_constructor qid kn =
let cdata = Tac2env.interp_constructor kn in
Expand Down
1 change: 1 addition & 0 deletions test-suite/output/ltac2_printabout.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Inr : 'b -> ('a, 'b) either
Triple : 'c -> 'b -> 'a -> ('a, 'b, 'c) triple
Not_found : exn
Out_of_bounds : message option -> exn
Ltac2 Notation nota := () ()
6 changes: 6 additions & 0 deletions test-suite/output/ltac2_printabout.v
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ Print Ltac2 Triple.

Print Ltac2 Not_found.
Print Ltac2 Out_of_bounds.

(* alias *)

Ltac2 Notation nota := () ().

Print nota.

0 comments on commit 94616b4

Please sign in to comment.