src/Pure/Isar/toplevel.ML
changeset 60190 906de96ba68a
parent 60189 0d3a62127057
child 60245 79ad597fe699
     1.1 --- a/src/Pure/Isar/toplevel.ML	Wed Apr 22 19:48:32 2015 +0200
     1.2 +++ b/src/Pure/Isar/toplevel.ML	Wed Apr 22 20:14:43 2015 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4    val exit: transition -> transition
     1.5    val keep: (state -> unit) -> transition -> transition
     1.6    val keep': (bool -> state -> unit) -> transition -> transition
     1.7 +  val keep_proof: (state -> unit) -> transition -> transition
     1.8    val ignored: Position.T -> transition
     1.9    val is_ignored: transition -> bool
    1.10    val malformed: Position.T -> string -> transition
    1.11 @@ -345,6 +346,12 @@
    1.12  
    1.13  fun keep f = add_trans (Keep (fn _ => f));
    1.14  
    1.15 +fun keep_proof f =
    1.16 +  keep (fn st =>
    1.17 +    if is_proof st then f st
    1.18 +    else if is_skipped_proof st then ()
    1.19 +    else warning "No proof state");
    1.20 +
    1.21  fun ignored pos = empty |> name "<ignored>" |> position pos |> keep (fn _ => ());
    1.22  fun is_ignored tr = name_of tr = "<ignored>";
    1.23