Skip to content

Commit

Permalink
Indicate correct way to implement parsing in theory add-ons
Browse files Browse the repository at this point in the history
Workaround for issue identified in github issue #1370
  • Loading branch information
mn200 committed Dec 18, 2024
1 parent 5f08f9b commit 2553223
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/1/theory_tests/gh1370Script.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
open HolKernel boolLib

val _ = new_theory"gh1370";

val _ = new_definition ("def", “c = T”);

val _ =
adjoin_to_theory
{sig_ps = SOME (fn _ => PP.add_string "val ctm : Term.term"),
struct_ps = NONE};

val _ = adjoin_after_completion
(fn _ => PP.add_string ("val ctm = Parse.Term ‘c’;\n\n"))

val _ = export_theory();
11 changes: 11 additions & 0 deletions src/1/theory_tests/gh1370childScript.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
open HolKernel Parse boolLib

open gh1370Theory

val _ = new_theory "gh1370child";

val _ = type_of gh1370Theory.ctm = bool andalso
(print "ctm has correct type\n";true) orelse
OS.Process.exit OS.Process.failure

val _ = export_theory();

0 comments on commit 2553223

Please sign in to comment.