Skip to content

Commit

Permalink
Merge pull request #121 from ott-lang/fix-coq-comments
Browse files Browse the repository at this point in the history
only output plain comments in generated Coq code
  • Loading branch information
palmskog authored Dec 30, 2024
2 parents a14906c + 2cfa650 commit 8ce440c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions revision_history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,5 @@ Peter Sewell + Thibaut Pérami: Add "menhir-start-type" hom to specify the top l
2024-12 @palmskog: move y2l to non-aux directory to avoid Windows problems, fix doc build

2024-12 @palmskog: add coq-notation hom to allow using Coq Notation sentences instead of Definition

2024-12 @palmskog: only output plain comments in generated Coq code
2 changes: 1 addition & 1 deletion src/defns.ml
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ let pp_fun_or_reln_defnclass_list
List.iter (fun frdc -> pp_fun_or_reln_defnclass fd m xd lookup frdc) frdcs
| Coq co ->
pp_auxiliary_list_rules fd m xd frdcs;
output_string fd "(** definitions *)\n";
output_string fd "(* definitions *)\n";
List.iter (fun frdc -> pp_fun_or_reln_defnclass fd m xd lookup frdc) frdcs;
| Tex _ ->
output_string fd "% defnss\n";
Expand Down
6 changes: 2 additions & 4 deletions src/grammar_pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1401,8 +1401,7 @@ and pp_com_es m xd homs es =
^ String.concat "" (apply_hom_spec m xd hs ((*List.map (function s -> "$"^s^"$")*) ss))
^ "}"
| Isa _ -> " \\<comment> \\<open>" ^ String.concat "" (apply_hom_spec m xd hs ss) ^ "\\<close>"
| Coq _ -> " (*r " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " *)"
| Hol _ | Lem _ | Caml _ | Lex _ -> " (* " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " *)"
| Coq _ | Hol _ | Lem _ | Caml _ | Lex _ -> " (* " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " *)"
| Menhir _ -> "/* " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " */"
| Ascii _ | Twf _ -> ""

Expand All @@ -1416,8 +1415,7 @@ and pp_com_strings m xd homs ss =
^ String.concat "" (apply_hom_spec m xd hs (List.map (function s -> "$"^s^"$") ss))
^ "}"
| Isa _ -> " \\<comment> \\<open>" ^ String.concat "" (apply_hom_spec m xd hs ss) ^ "\\<close>"
| Coq _ -> " (*r " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " *)"
| Hol _ | Lem _ | Caml _ | Lex _ -> " (* " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " *)"
| Coq _ | Hol _ | Lem _ | Caml _ | Lex _ -> " (* " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " *)"
| Menhir _ -> "/* " ^ String.concat "" (apply_hom_spec m xd hs ss) ^ " */"
| Ascii _ | Twf _ -> ""

Expand Down

0 comments on commit 8ce440c

Please sign in to comment.