src/Pure/ML/ml_context.ML
changeset 26346 17debd2fff8e
parent 26336 a0e2b706ce73
child 26361 7946f459c6c8
equal deleted inserted replaced
26345:f70620a4cf81 26346:17debd2fff8e
   262 in val _ = () end;
   262 in val _ = () end;
   263 
   263 
   264 
   264 
   265 (** fact references **)
   265 (** fact references **)
   266 
   266 
   267 fun thm name = ProofContext.get_thm (the_local_context ()) (Facts.Named (name, NONE));
   267 fun thm name = ProofContext.get_thm (the_local_context ()) name;
   268 fun thms name = ProofContext.get_thms (the_local_context ()) (Facts.Named (name, NONE));
   268 fun thms name = ProofContext.get_thms (the_local_context ()) name;
   269 
   269 
   270 
   270 
   271 local
   271 local
   272 
   272 
   273 fun print_interval (Facts.FromTo arg) =
   273 fun print_interval (Facts.FromTo arg) =
   278 fun thm_sel name =
   278 fun thm_sel name =
   279   Scan.option Args.thm_sel >> (fn sel => "Facts.Named " ^
   279   Scan.option Args.thm_sel >> (fn sel => "Facts.Named " ^
   280     ML_Syntax.print_pair ML_Syntax.print_string
   280     ML_Syntax.print_pair ML_Syntax.print_string
   281       (ML_Syntax.print_option (ML_Syntax.print_list print_interval)) (name, sel));
   281       (ML_Syntax.print_option (ML_Syntax.print_list print_interval)) (name, sel));
   282 
   282 
   283 fun thm_antiq kind = value_antiq kind
   283 fun thm_antiq name get = value_antiq name
   284   (Scan.lift (Args.name :-- thm_sel) >> apsnd (fn sel =>
   284   (Scan.lift (Args.name :-- thm_sel) >> apsnd (fn sel =>
   285     "ProofContext.get_" ^ kind ^ " (ML_Context.the_local_context ()) " ^ ML_Syntax.atomic sel));
   285     get ^ " (ML_Context.the_local_context ()) " ^ ML_Syntax.atomic sel));
   286 
   286 
   287 in
   287 in
   288 
   288 
   289 val _ = add_keywords ["(", ")", "-", ","];
   289 val _ = add_keywords ["(", ")", "-", ","];
   290 val _ = thm_antiq "thm";
   290 val _ = thm_antiq "thm" "ProofContext.get_fact_single";
   291 val _ = thm_antiq "thms";
   291 val _ = thm_antiq "thms" "ProofContext.get_fact";
   292 
   292 
   293 end;
   293 end;
   294 
   294 
   295 val _ = proj_value_antiq "cpat" (Scan.lift Args.name >>
   295 val _ = proj_value_antiq "cpat" (Scan.lift Args.name >>
   296     (fn name => ("cpat",
   296     (fn name => ("cpat",