src/Pure/Tools/find_consts.ML
changeset 56912 293cd4dcfebc
parent 56908 734f7e6151c9
child 57918 f5d73caba4e5
equal deleted inserted replaced
56911:dc3ba749d3b8 56912:293cd4dcfebc
   110 
   110 
   111     val matches =
   111     val matches =
   112       fold (fn c => (case eval_entry c of NONE => I | SOME rank => cons (rank, c))) constants []
   112       fold (fn c => (case eval_entry c of NONE => I | SOME rank => cons (rank, c))) constants []
   113       |> sort (prod_ord (rev_order o int_ord) (string_ord o pairself fst))
   113       |> sort (prod_ord (rev_order o int_ord) (string_ord o pairself fst))
   114       |> map (apsnd fst o snd);
   114       |> map (apsnd fst o snd);
       
   115 
       
   116     val position_markup = Position.markup (Position.thread_data ()) Markup.position;
   115   in
   117   in
   116     Pretty.block
   118     Pretty.block
   117       (Pretty.fbreaks (Pretty.keyword1 "find_consts" :: map pretty_criterion raw_criteria)) ::
   119       (Pretty.fbreaks
       
   120         (Pretty.mark position_markup (Pretty.keyword1 "find_consts") ::
       
   121           map pretty_criterion raw_criteria)) ::
   118     Pretty.str "" ::
   122     Pretty.str "" ::
   119     (if null matches then [Pretty.str "found nothing"]
   123     (if null matches then [Pretty.str "found nothing"]
   120      else
   124      else
   121        Pretty.str ("found " ^ string_of_int (length matches) ^ " constant(s):") ::
   125        Pretty.str ("found " ^ string_of_int (length matches) ^ " constant(s):") ::
   122        grouped 10 Par_List.map (Pretty.item o single o pretty_const ctxt) matches)
   126        grouped 10 Par_List.map (Pretty.item o single o pretty_const ctxt) matches)