src/Pure/Tools/find_consts.ML
changeset 38334 c677c2c1d333
parent 36953 2af1ad9aa1a3
child 38335 630f379f2660
     1.1 --- a/src/Pure/Tools/find_consts.ML	Wed Aug 11 17:37:04 2010 +0200
     1.2 +++ b/src/Pure/Tools/find_consts.ML	Wed Aug 11 17:50:29 2010 +0200
     1.3 @@ -144,19 +144,22 @@
     1.4  
     1.5  (* command syntax *)
     1.6  
     1.7 -fun find_consts_cmd spec =
     1.8 -  Toplevel.unknown_theory o Toplevel.keep (fn state =>
     1.9 -    find_consts (Proof.context_of (Toplevel.enter_proof_body state)) spec);
    1.10 +local
    1.11  
    1.12  val criterion =
    1.13    Parse.reserved "strict" |-- Parse.!!! (Parse.$$$ ":" |-- Parse.xname) >> Strict ||
    1.14    Parse.reserved "name" |-- Parse.!!! (Parse.$$$ ":" |-- Parse.xname) >> Name ||
    1.15    Parse.xname >> Loose;
    1.16  
    1.17 +in
    1.18 +
    1.19  val _ =
    1.20    Outer_Syntax.improper_command "find_consts" "search constants by type pattern" Keyword.diag
    1.21      (Scan.repeat ((Scan.option Parse.minus >> is_none) -- criterion)
    1.22 -      >> (Toplevel.no_timing oo find_consts_cmd));
    1.23 +      >> (fn spec => Toplevel.no_timing o
    1.24 +        Toplevel.keep (fn state => find_consts (Toplevel.context_of state) spec)));
    1.25  
    1.26  end;
    1.27  
    1.28 +end;
    1.29 +