src/Pure/General/completion.ML
changeset 69347 54b95d2ec040
parent 69289 bf6937af7fe8
child 71911 d25093536482
equal deleted inserted replaced
69346:3c29edccf739 69347:54b95d2ec040
    10   type T
    10   type T
    11   val names: Position.T -> name list -> T
    11   val names: Position.T -> name list -> T
    12   val none: T
    12   val none: T
    13   val make: string * Position.T -> ((string -> bool) -> name list) -> T
    13   val make: string * Position.T -> ((string -> bool) -> name list) -> T
    14   val encode: T -> XML.body
    14   val encode: T -> XML.body
    15   val markup_element: T -> Markup.T * XML.body
    15   val markup_element: T -> (Markup.T * XML.body) option
    16   val markup_report: T list -> string
    16   val markup_report: T list -> string
    17   val make_report: string * Position.T -> ((string -> bool) -> name list) -> string
    17   val make_report: string * Position.T -> ((string -> bool) -> name list) -> string
    18   val suppress_abbrevs: string -> Markup.T list
    18   val suppress_abbrevs: string -> Markup.T list
    19   val check_option: Options.T -> Proof.context -> string * Position.T -> string
    19   val check_option: Options.T -> Proof.context -> string * Position.T -> string
    20   val check_option_value:
    20   val check_option_value:
    55   in pair int (list (pair string (pair string string))) (total, names) end;
    55   in pair int (list (pair string (pair string string))) (total, names) end;
    56 
    56 
    57 fun markup_element completion =
    57 fun markup_element completion =
    58   let val {pos, names, ...} = dest completion in
    58   let val {pos, names, ...} = dest completion in
    59     if Position.is_reported pos andalso not (null names) then
    59     if Position.is_reported pos andalso not (null names) then
    60       (Position.markup pos Markup.completion, encode completion)
    60       SOME (Position.markup pos Markup.completion, encode completion)
    61     else (Markup.empty, [])
    61     else NONE
    62   end;
    62   end;
    63 
    63 
    64 val markup_report =
    64 val markup_report =
    65   map (markup_element #> XML.Elem) #> YXML.string_of_body #> Markup.markup_report;
    65   map_filter markup_element #> map XML.Elem #> YXML.string_of_body #> Markup.markup_report;
    66 
    66 
    67 val make_report = markup_report oo (single oo make);
    67 val make_report = markup_report oo (single oo make);
    68 
    68 
    69 
    69 
    70 (* suppress short abbreviations *)
    70 (* suppress short abbreviations *)