binding in antiquotations
authorChristian Urban <urbanc@in.tum.de>
Tue, 28 Jun 2011 08:44:34 +0100
changeset 470 817ecad4cf72
parent 469 7a558c5119b2
child 471 f65b9f14d5de
binding in antiquotations
ProgTutorial/antiquote_setup.ML
ProgTutorial/output_tutorial.ML
--- a/ProgTutorial/antiquote_setup.ML	Tue Jun 21 12:53:16 2011 +0100
+++ b/ProgTutorial/antiquote_setup.ML	Tue Jun 28 08:44:34 2011 +0100
@@ -98,17 +98,17 @@
 val two_args   = Scan.lift (Args.name -- Args.name)
 val test = Scan.lift (Args.name -- Args.name -- Scan.option (Args.$$$ "with"  |-- Args.name))
 
-val _ = Thy_Output.antiquotation "ML" parser_ml output_ml
-val _ = Thy_Output.antiquotation "ML_ind" parser_ml_ind output_ml_ind
-val _ = Thy_Output.antiquotation "ML_type" single_arg output_type
-val _ = Thy_Output.antiquotation "ML_type_ind" single_arg output_type_ind
-val _ = Thy_Output.antiquotation "ML_struct" single_arg output_struct
-val _ = Thy_Output.antiquotation "ML_struct_ind" single_arg output_struct_ind
-val _ = Thy_Output.antiquotation "ML_funct" single_arg output_funct
-val _ = Thy_Output.antiquotation "ML_funct_ind" single_arg output_funct_ind
-val _ = Thy_Output.antiquotation "ML_response" two_args output_response
-val _ = Thy_Output.antiquotation "ML_response_fake" two_args output_response_fake
-val _ = Thy_Output.antiquotation "ML_response_fake_both" two_args ouput_response_fake_both
+val _ = Thy_Output.antiquotation @{binding "ML"} parser_ml output_ml
+val _ = Thy_Output.antiquotation @{binding "ML_ind"} parser_ml_ind output_ml_ind
+val _ = Thy_Output.antiquotation @{binding "ML_type"} single_arg output_type
+val _ = Thy_Output.antiquotation @{binding "ML_type_ind"} single_arg output_type_ind
+val _ = Thy_Output.antiquotation @{binding "ML_struct"} single_arg output_struct
+val _ = Thy_Output.antiquotation @{binding "ML_struct_ind"} single_arg output_struct_ind
+val _ = Thy_Output.antiquotation @{binding "ML_funct"} single_arg output_funct
+val _ = Thy_Output.antiquotation @{binding "ML_funct_ind"} single_arg output_funct_ind
+val _ = Thy_Output.antiquotation @{binding "ML_response"} two_args output_response
+val _ = Thy_Output.antiquotation @{binding "ML_response_fake"} two_args output_response_fake
+val _ = Thy_Output.antiquotation @{binding "ML_response_fake_both"} two_args ouput_response_fake_both
 
 (* FIXME: experimental *)
 fun ml_eq (lhs, pat, eq) =
@@ -120,7 +120,7 @@
      | SOME e => eval_fn ctxt (ml_eq (lhs, pat, e));
      output ctxt ((prefix_lines "" lhs) @ (prefix_lines "> " pat)))
 
-val _ = Thy_Output.antiquotation "ML_response_eq" test output_response_eq
+val _ = Thy_Output.antiquotation @{binding "ML_response_eq"} test output_response_eq
 
 (* checks whether a file exists in the Isabelle distribution *)
 fun href_link txt =
@@ -136,7 +136,7 @@
    then output ctxt [href_link txt]
    else error (implode ["Source file ", quote txt, " does not exist."]))
 
-val _ = Thy_Output.antiquotation "ML_file" single_arg check_file_exists
+val _ = Thy_Output.antiquotation @{binding "ML_file"} single_arg check_file_exists
 
 
 (* replaces the official subgoal antiquotation with one *)
@@ -176,7 +176,7 @@
   Thy_Output.output ctxt output
 end
 
-val _ = Thy_Output.antiquotation "subgoals" (Scan.succeed ()) output_goals
-val _ = Thy_Output.antiquotation "raw_goal_state" (Scan.succeed ()) output_raw_goal_state
+val _ = Thy_Output.antiquotation @{binding "subgoals"} (Scan.succeed ()) output_goals
+val _ = Thy_Output.antiquotation @{binding "raw_goal_state"} (Scan.succeed ()) output_raw_goal_state
 
 end;
--- a/ProgTutorial/output_tutorial.ML	Tue Jun 21 12:53:16 2011 +0100
+++ b/ProgTutorial/output_tutorial.ML	Tue Jun 28 08:44:34 2011 +0100
@@ -84,9 +84,9 @@
   | boolean "false" = false
   | boolean s = error ("Bad boolean value: " ^ quote s);
 
-val _ = Thy_Output.add_option "gray" 
+val _ = Thy_Output.add_option @{binding "gray"} 
   (Thy_Output.add_wrapper o Library.setmp_CRITICAL gray o boolean)
-val _ = Thy_Output.add_option "linenos"  
+val _ = Thy_Output.add_option @{binding "linenos"}  
   (Thy_Output.add_wrapper o Library.setmp_CRITICAL linenos o boolean)
 
 end
\ No newline at end of file