text
stringlengths
12
786k
let add_type env full_name = let simple_name = Name . simple full_name in { env with env_types = ( simple_name , full_name ) :: env . env_types }
let add_value env full_name = let simple_name = Name . simple full_name in { env with env_values = ( simple_name , full_name ) :: env . env_values }
let add_module env full_name = let simple_name = Name . simple full_name in { env with env_modules = ( simple_name , full_name ) :: env . env_modules }
let add_module_type env full_name = let simple_name = Name . simple full_name in { env with env_module_types = ( simple_name , full_name ) :: env . env_module_types }
let add_class env full_name = let simple_name = Name . simple full_name in { env with env_classes = ( simple_name , full_name ) :: env . env_classes ; env_types = ( simple_name , full_name ) :: env . env_types }
let add_class_type env full_name = let simple_name = Name . simple full_name in { env with env_class_types = ( simple_name , full_name ) :: env . env_class_types ; env_types = ( simple_name , full_name ) :: env . env_types }
let full_module_name env n = try List . assoc n env . env_modules with Not_found -> n
let full_module_type_name env n = try List . assoc n env . env_module_types with Not_found -> n
let full_module_or_module_type_name env n = try List . assoc n env . env_modules with Not_found -> full_module_type_name env n
let full_type_name env n = try let full = List . assoc n env . env_types in full with Not_found -> n
let full_value_name env n = try List . assoc n env . env_values with Not_found -> n
let full_extension_constructor_name env n = try List . assoc n env . env_extensions with Not_found -> n
let full_class_name env n = try List . assoc n env . env_classes with Not_found -> n
let full_class_type_name env n = try List . assoc n env . env_class_types with Not_found -> n
let full_class_or_class_type_name env n = try List . assoc n env . env_classes with Not_found -> full_class_type_name env n
let subst_type env t = Printtyp . mark_loops t ; let deja_vu = ref [ ] in let rec iter t = if List . memq t ! deja_vu then ( ) else begin deja_vu := t :: ! deja_vu ; Btype . iter_type_expr iter t ; match t . Types . desc with | Types . Tconstr ( p , [ _ ] , _ ) when Path ...
let subst_module_type env t = let rec iter t = let open Types in match t with Mty_ident p -> let new_p = Odoc_name . to_path ( full_module_type_name env ( Odoc_name . from_path p ) ) in Mty_ident new_p | Mty_alias _ | Mty_signature _ -> t | Mty_functor ( Unit , mt ) -> Mty_functor ( Unit ...
let subst_class_type env t = let rec iter t = match t with Types . Cty_constr ( p , texp_list , ct ) -> let new_p = Odoc_name . to_path ( full_type_name env ( Odoc_name . from_path p ) ) in let new_texp_list = List . map ( subst_type env ) texp_list in let new_ct = iter ct in Types . ...
object method generate : Odoc_module . t_module list -> unit end ; ;
module type Base = sig class generator : doc_generator end ; ;
module Base_generator : Base = struct class generator : doc_generator = object method generate _ = ( ) end end ; ;
module type Base_functor = Base -> Base
module type Html_functor = Odoc_html . Html_generator -> Odoc_html . Html_generator
module type Latex_functor = Odoc_latex . Latex_generator -> Odoc_latex . Latex_generator
module type Texi_functor = Odoc_texi . Texi_generator -> Odoc_texi . Texi_generator
module type Man_functor = Odoc_man . Man_generator -> Odoc_man . Man_generator
module type Dot_functor = Odoc_dot . Dot_generator -> Odoc_dot . Dot_generator
type generator = | Html of ( module Odoc_html . Html_generator ) | Latex of ( module Odoc_latex . Latex_generator ) | Texi of ( module Odoc_texi . Texi_generator ) | Man of ( module Odoc_man . Man_generator ) | Dot of ( module Odoc_dot . Dot_generator ) | Base of ( module Base ) ...
let get_minimal_generator = function Html m -> let module M = ( val m : Odoc_html . Html_generator ) in ( new M . html :> doc_generator ) let module M = ( val m : Odoc_latex . Latex_generator ) in ( new M . latex :> doc_generator ) let module M = ( val m : Odoc_man . Man_generator ...
let _ = Clflags . dont_write_files := true
type source_file = Impl_file of string | Intf_file of string | Text_file of string
let errors = ref 0
let warn_error = ref false
let show_missed_crossref = ref false
let pwarning s = if ! Odoc_config . print_warnings then prerr_endline ( Odoc_messages . warning " ^: " ^ s ) ; if ! warn_error then incr errors
let merge_options = ref ( [ ] : Odoc_types . merge_option list )
let dump = ref ( None : string option )
let load = ref ( [ ] : string list )
let sort_modules = ref false
let no_custom_tags = ref false
let no_stop = ref false
let remove_stars = ref false
let keep_code = ref false
let inverse_merge_ml_mli = ref false
let filter_with_module_constraints = ref true
let hidden_modules = ref ( [ ] : string list )
let files = ref [ ]
let out_file = ref Odoc_messages . default_out_file
let target_dir = ref Filename . current_dir_name
let title = ref ( None : string option )
let intro_file = ref ( None : string option )
let with_header = ref true
let with_trailer = ref true
let with_toc = ref true
let with_index = ref true
let initially_opened_module = ref " Stdlib "
let library_namespace = ref " "
let with_parameter_list = ref false
let css_style = ref None
let index_only = ref false
let colorize_code = ref false
let html_short_functors = ref false
let charset = ref " iso - 8859 - 1 "
module Naming = struct let mark_module = " MODULE " let mark_module_type = " MODULETYPE " let mark_type = " TYPE " let mark_type_elt = " TYPEELT " let mark_function = " FUN " let mark_extension = " EXTENSION " let mark_exception = " EXCEPTION " let mark_value = " VAL " let mark_...
let new_buf ( ) = Buffer . create 1024
let bs = Buffer . add_string object ( self ) inherit ocaml_code method escape s = Odoc_ocamlhtml . escape_base s method keep_alpha_num s = let len = String . length s in let buf = Buffer . create len in for i = 0 to len - 1 do match s . [ i ] with ' a ' . . ' z ' | ' A ' . ...
let print_concat b sep f = let rec iter = function [ ] -> ( ) | [ c ] -> f c | c :: q -> f c ; bs b sep ; iter q in iter
let newline_to_indented_br s = let len = String . length s in let b = Buffer . create len in for i = 0 to len - 1 do match s . [ i ] with ' \ n ' -> Buffer . add_string b " < br > " | c -> Buffer . add_char b c done ; Buffer . contents b
module Generator = struct object ( self ) inherit text inherit info val mutable doctype = " <! DOCTYPE HTML PUBLIC " \-// W3C // DTD HTML 4 . 01 Transitional // EN " \>\ n " method character_encoding b = bp b " < meta content " =\ text / html ; charset =% s " \ http - equiv " =\...
module type Html_generator = module type of Generator
type ref_kind = Odoc_types . ref_kind = RK_module | RK_module_type | RK_class | RK_class_type | RK_value | RK_type | RK_extension | RK_exception | RK_attribute | RK_method | RK_section of text | RK_recfield | RK_const | Raw of string | Code of string | CodePre of string | Verbatim of string | Bold ...
type see_ref = Odoc_types . see_ref = See_url of string | See_file of string | See_doc of string
type see = see_ref * text
type param = ( string * text )
type raised_exception = ( string * text )
type info = Odoc_types . info = { i_desc : text option ; i_authors : string list ; i_version : string option ; i_sees : see list ; i_since : string option ; i_before : ( string * text ) list ; i_deprecated : text option ; i_params : param list ; i_raised_exceptions : raised_exception...
type location = Odoc_types . location = { loc_impl : Location . t option ; loc_inter : Location . t option ; }
let dummy_loc = { loc_impl = None ; loc_inter = None }
let analyse_files ( ? merge_options ( [ ] = : Odoc_types . merge_option list ) ) ( ? include_dirs ( [ ] = : string list ) ) ( ? labels = false ) ( ? sort_modules = false ) ( ? no_stop = false ) ( ? init [ ] ) = files = Odoc_global . merge_options := merge_...
let string_of_variance t ( co , cn ) = Odoc_str . string_of_variance t ( co , cn )
let string_of_type_expr t = Odoc_print . string_of_type_expr t
let string_of_type_list ? par sep type_list = Odoc_str . string_of_type_list ? par sep type_list
let string_of_type_param_list t = Odoc_str . string_of_type_param_list t
let string_of_type_extension_param_list te = Odoc_str . string_of_type_extension_param_list te
let string_of_class_type_param_list l = Odoc_str . string_of_class_type_param_list l
let string_of_text t = Odoc_misc . string_of_text t
let string_of_info i = Odoc_misc . string_of_info i
let string_of_type t = Odoc_str . string_of_type t
let string_of_record t = Odoc_str . string_of_record t
let string_of_type_extension te = Odoc_str . string_of_type_extension te
let string_of_exception e = Odoc_str . string_of_exception e
let string_of_value v = Odoc_str . string_of_value v
let string_of_attribute att = Odoc_str . string_of_attribute att
let string_of_method m = Odoc_str . string_of_method m
let use_hidden_modules n = Odoc_name . hide_given_modules ! Odoc_global . hidden_modules n
let verbose s = if ! Odoc_global . verbose then ( print_string s ; print_newline ( ) ) else ( )
let warning s = Odoc_global . pwarning s
let apply_if_equal f v1 v2 = if v1 = v2 then f v1 else v2
let escape_arobas s = let len = String . length s in let b = Buffer . create len in for i = 0 to len - 1 do match s . [ i ] with ' ' @ -> Buffer . add_string b " " \\@ | c -> Buffer . add_char b c done ; Buffer . contents b
let info_string_of_info i = let b = Buffer . create 256 in let p = Printf . bprintf in ( match i . i_desc with None -> ( ) | Some t -> p b " % s " ( escape_arobas ( text_string_of_text t ) ) ) ; List . iter ( fun s -> p b " \ n @@ author % s " ( escape_arobas s ) ) ...