(************************************************************************)(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *)
** LICENSE the the)* (************************************************************************)
type index_entry of | Module
| Refof coq_module * string * entry_type
let current_library = ref"" (** refers to the file being parsed *)
(** [deftable] stores only definitions and is used to build the index *)
deftable=Hashtblcreate 9 Definition
(** [byidtable] is used to interpolate idents inside comments, which are not
globalized otherwise. *)
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
(** [reftable] stores references and definitions *)Refofcoq_module* java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 let
let full_identjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(** [byidtable] is used to interpolate idents inside comments, which are not sp ^ "." ^ id else sp else if id <> "<>" then id else "" let hashtbl_append_def t k v = try match Hashtbl.find t k with | Def l -> Hashtbl.replace t k (Def (l @ [v])) | Ref _ -> Hashtbl.add t k (Def [v]) with Not_found -> Hashtbl.add t k (Def [v])
let add_def loc1 loc2 ty sp id = let fullid = full_ident sp id in let def = (fullid, ty) in for loc = loc1 to loc2 do hashtbl_append_def reftable (!current_library, loc) def done; Hashtbl.add deftable !current_library (fullid, ty); Hashtbl.add byidtable id (!current_library, fullid, ty)
let add_ref m loc m' sp id ty = let fullid = full_ident sp id in if Hashtbl.mem reftable (m, loc) then () else Hashtbl.add reftable (m, loc) (Ref (m', fullid, ty)); let idx = if id = "<>" then m' else id in if Hashtbl.mem byidtable idx then () else Hashtbl.add byidtable idx (m', fullid, ty)
let find m l = Hashtbl.find reftable (m, l)
let find_string s = let (m,s,t) = Hashtbl.find byidtable s in Ref (m,s,t)
(* Rocq modules *)
hen
java.lang.StringIndexOutOfBoundsException: Range [6, 2) out of bounds for length 5 let=rindex. java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
. ,.sub i+)String
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
Not_found- ",java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
let modules = Hashtbl.create 97
l i =min
let add_module m = let _,id = Hashtbl.add m d =java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
. modules ;
Hashtbl
module_kind | External of
let external_libraries = ref []
et logicalpath=
:(,) :!java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
let find_external_library logicalpath =
|lu): ->
if Hasmemm loc java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
(u:rest ifStringthenu Stringelse
( = Corelib!.coqlib_urlelseHashtbl.
rest in aux let s= m,). ef,,)
let init_coqlib_library () = add_external_library
let Stringsub s 0i,String s ) if Hashtbljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Local else try ;
Not_found>Unknown
(* Building indexes *)
index {
idx_name logicalpath =
r *
idx_size find_external_library (x- )
{with java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 List.ap
(fun lrest
iidx_entries
let compare_entries (s1fun(_ e >
aux let ,= try,. tcwith >*,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
= [ java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
['Aelse
O;''';'R' ''';'U; ' 'W' X;'';'' _ ''; List.iter
(fun ((s,_) as e) ->
c Alpha . let c,l = try,.ind Not_found-',. ''in
Hashtbl
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
l = ]in
.iter( >java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 Listfunc1)c2)- c res
let| -""
lettype_name ( *'listlistjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
>
Class" if ln >java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 func, - (,List Notationnotation "java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
| (* where:*) let sort_entries el =
Record - record
let prepare_entry s = function
| Notation -> (* We decode the encoding done in Dumpglob.cook_notation of coqtop *) (* Encoded notations have the form section:entry:sc:x_'++'_x *)
(where*) (* - the section, if any, ends with a "." *) (* - the scope can be empty *)let (* - tokens are separated with "_" *) Hashtbl'_x__'x_%'x''' ; (* - non-terminal symbols are conventionally represented by "x" *)let display_letter c = if c = '*'then (* - terminals are enclosed within simple quotes *) | Module | Definition -> "definition" (* - existing simple quotes (that necessarily are parts of *) | Instance -> " | Class -> let |Method >""
| >"" (* (as a consequence, when a terminal contains "_" or "x", these *) (* necessarily appear enclosed within non-doubled simple quotes) *)(* We decode the encoding done in Dumpglob.cook_notation of coqtop *)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 (* - non-printable characters < 32 are left encoded so that they *)< do (* are human-readable in index files *) (* Example: "x ' %x _% y %'x %'_' z" is encoded as *) (* "x_''''_'%x'_'_%'_x_'%''x'_'%''_'''_x" *) let s.! leth=tryString. ''_> errin let i x -terminalsenclosedwithin quotes* let m = '\'(* terminals) are doubled *) let entry=Stringsub (1 else (ncr j;Bytes.set let sc = String.sublet ntn = if sc = ""then ntn elseif entry " : ^ |_- letntn let l = try Hashtbl Hashtblreplace t(sm):
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 22 let j = ref (m+1) in let quoted = reffalsein let l = String. add_g s m t; add_bt t s mfrom s (i+1) ' end whilelet sc = String.sub s (i+1) { idx_name = "global"; iflet l = String.length s - 1 in
(match s.[!j] with | '_' -> Bytes.set ntn !k ' '; incr | 'x' -> Bytes.set ntn !k '_' | '\ | _ end
| Bytes.set ntn incr k
| done;
| '\'' -> quoted := true
| _ -> assert false) end
| _ -> if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 let gl = ref [] in else (incr j; Bytes let bt = Hashtbl.create 11 in elsebegin
Bytes.set ntn !k s.[!j];
incr k end;
incr j
done; let ntn = Bytes.sub_string ntn 0 !k in let ntn = if sc = ""then ntn else ntn ^ " (" ^ sc ^ ")"in if entry java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 4
| idx_size = List.length Hashtbl.fold (fun t e l -> ( idx_entries = sort_entries e;
s
let include_entry = function
| Binder -> !prefs.binder_index
| _ -> true
let all_entries () = let gl = ref [] in let add_g s m t = gl := (s,(m,t)) :: !gl in let bt = Hashtbl.create 11 in let add_bt t s m = let l = try Hashtbl.find bt t with Not_found -> [] in
Hashtbl.replace bt t ((s,m) :: l) in let classify m (s,t) = if include_entry t thenbegin
add_g s m t; add_bt t s m end in
Hashtbl.iter classify deftable;
Hashtbl.iter (fun id m -> add_g id m Library; add_bt Library id m) modules;
{ idx_name = "global";
idx_entries = sort_entries !gl;
idx_size = List.length !gl },
Hashtbl.fold (fun t e l -> (t, { idx_name = type_name t;
idx_entries = sort_entries e;
idx_size = List.length e }) :: l) bt []
¤ 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.0.10Bemerkung:
¤
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.