ML_Context.add_antiq: pass position;
authorwenzelm
Thu, 14 Aug 2008 16:52:56 +0200
changeset 27869 af1f79cbc198
parent 27868 a28b3cd0077b
child 27870 643673ebe065
ML_Context.add_antiq: pass position; @{lemma}: set source position;
src/Pure/ML/ml_thms.ML
--- a/src/Pure/ML/ml_thms.ML	Thu Aug 14 16:52:54 2008 +0200
+++ b/src/Pure/ML/ml_thms.ML	Thu Aug 14 16:52:56 2008 +0200
@@ -35,7 +35,7 @@
 (* fact references *)
 
 fun thm_antiq kind scan = ML_Context.add_antiq kind
-  (scan >> (fn ths => fn {struct_name, background} =>
+  (fn _ => scan >> (fn ths => fn {struct_name, background} =>
     let
       val i = serial ();
       val (a, background') = background
@@ -53,12 +53,13 @@
 val goal = Scan.unless (Scan.lift by) Args.prop;
 
 val _ = ML_Context.add_antiq "lemma"
-  (Args.context -- Args.mode "open" -- Scan.repeat1 goal --
+  (fn pos => Args.context -- Args.mode "open" -- Scan.repeat1 goal --
       Scan.lift (by |-- Method.parse -- Scan.option Method.parse) >>
     (fn (((ctxt, is_open), props), methods) => fn {struct_name, background} =>
       let
         val i = serial ();
-        val prep_result = Goal.norm_result #> not is_open ? Thm.close_derivation;
+        val prep_result =
+          Goal.norm_result #> Thm.default_position pos #> not is_open ? Thm.close_derivation;
         fun after_qed [res] goal_ctxt =
           put_thms (i, map prep_result (ProofContext.export goal_ctxt ctxt res)) goal_ctxt;
         val ctxt' = ctxt