signature COMPLETION = sig type name = string * (string * string) type T val names: Position.T -> name list -> T val none: T val make: string * Position.T -> ((string -> bool) -> name list) -> T val encode: T -> XML.body val markup_element: T -> (Markup.T * XML.body) option val markup_report: T list -> string val make_report: string * Position.T -> ((string -> bool) -> name list) -> string val suppress_abbrevs: string -> Markup.T list val check_item: string -> (string * 'a -> Markup.T) ->
(string * 'a) list -> Proof.context -> string * Position.T -> string val check_entity: string -> (string * Position.T) list ->
Proof.context -> string * Position.T -> string val check_option: Options.T -> Proof.context -> string * Position.T -> string val check_option_value:
Proof.context -> string * Position.T -> string * Position.T -> Options.T -> string * Options.T end;
structure Completion: COMPLETION = struct
(* completion of names *)
type name = string * (string * string); (*external name, kind, internal name*)
abstype T = Completion of {pos: Position.T, total: int, names: name list} with
fun dest (Completion args) = args;
fun names pos names =
Completion
{pos = pos,
total = length names,
names = take (Options.default_int "completion_limit") names};
end;
val none = names Position.none [];
fun make (name, pos) make_names = if Position.is_reported pos andalso name <> "" andalso name <> "_" then names pos (make_names (String.isPrefix (Name.clean name))) else none;
fun encode completion = let val {total, names, ...} = dest completion; open XML.Encode; in pair int (list (pair string (pair stringstring))) (total, names) end;
fun markup_element completion = letval {pos, names, ...} = dest completion in if Position.is_reported pos andalso not (null names) then
SOME (Position.markup_properties pos Markup.completion, encode completion) else NONE end;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.