text
stringlengths
0
601k
let convertTypeMakeTupleUnit ( p : parameters ) ( tp : Typ . t ) : type_descr = match ! tp with | Typ . TComposed ( [ " tuple " ] , _ , _ ) -> let new_type = Replacements . getType p . repl " unit " in CTSimple new_type | _ -> convertType p tp
let convertTypeList ( p : parameters ) ( tp : Typ . t list ) : type_descr list = List . map ( convertType p ) tp
let convertTypedId ( p : parameters ) ( is_val : lhs_kind ) ( e : typed_id ) : arg_type * string = match e with | SimpleId ( _ , _ , _ ) -> failwith " ProgToCode . convertTypedId : everything should have types " | TypedId ( id , typ , _ , _ ) -> let ftype = Typ . first typ in let typ_c = convertType p ftype in let typ_...
let getCast ( p : parameters ) ( from_type : type_descr ) ( to_type : type_descr ) : string = match from_type , to_type with | CTSimple from_t , CTSimple to_t -> Replacements . getCast p . repl from_t to_t | _ -> let from_str = show_type_descr from_type in let to_str = show_type_descr to_type in failwith ( " ProgToCode...
let makeNestedCall ( typ : type_descr ) ( name : string ) ( args : cexp list ) : cexp = match args with | [ ] -> failwith " ProgToCode . makeNestedCall : invalid number of arguments " | [ _ ; _ ] -> CECall ( name , args , typ ) | h :: t -> List . fold_left ( fun acc a -> CECall ( name , [ acc ; a ] , typ ) ) h t
let convertOperator ( p : parameters ) ( op : string ) ( typ : type_descr ) ( elems : cexp list ) : cexp = match typ with | CTSimple typ_t -> begin match Replacements . getFunctionForOperator p . repl op typ_t with | Some fn -> makeNestedCall typ fn elems | None -> let new_op = Replacements . getOperator p . repl op ty...
let getFunctionSetType ( elem_typs : type_descr list ) : type_descr = match elem_typs with | [ _ ; _ ; v ] -> v | _ -> failwith " ProgToCode . getFunctionSetType : this is not a call to ' set ' "
let getFunctionFirstArgType ( elem_typs : type_descr list ) : type_descr = match elem_typs with | v :: _ -> v | _ -> failwith " ProgToCode . getFunctionFirstArgType : this is not a call to ' split ' "
let createWhileLoopInit size init lhs = match init with | CECall ( name , [ ] , descr ) -> let il = CLId ( CTSimple " int " , [ " i " ] ) in let i = CEVar ( " i " , CTSimple " int " ) in let decl = CSVar ( il , None ) in let init_decl = CSBind ( il , CEInt 0 ) in let indexed = CEIndex ( lhs , i , CTSimple " any " ) in ...
let inlineArrayInit size init var = match var with | CEVar _ | CEAccess _ -> createWhileLoopInit size init var | _ -> failwith " inlineArrayInit "
let getInitArrayFunction ( p : parameters ) ( typ : type_descr ) : string option = match typ with | CTSimple typ_t -> begin match Replacements . getArrayInit p . repl typ_t with | Some fn -> Some fn | _ -> None end | _ -> None
let getCopyArrayFunction ( p : parameters ) ( typ : type_descr ) : string = match typ with | CTSimple typ_t -> begin match Replacements . getArrayCopy p . repl typ_t with | Some fn -> fn | _ -> failwith ( " getCopyArrayFunction : Invalid array type " ^ show_type_descr typ ) end | _ -> failwith ( " getCopyArrayFunction ...
let convertFunction ( p : parameters ) ( name : Id . t ) ( typ : type_descr ) ( elems : cexp list ) ( elem_typs : type_descr list ) : cexp = match name with | [ " set " ] -> begin match getFunctionSetType elem_typs with | CTSimple typ_t -> let fn = Replacements . getFunction p . repl " set " typ_t in CECall ( fn , elem...
let attrType ( p : parameters ) ( attr : attr ) : type_descr = match attr . typ with | Some t -> convertType p t | _ -> failwith " ProgToCode . attrType : everything should have types "
let expType ( p : parameters ) ( e : exp ) : type_descr = GetAttr . fromExp e |> attrType p
let rec convertExp ( p : parameters ) ( e : exp ) : cexp = let typ = attrType p in match e with | PUnit _ -> CEEmpty | PBool ( v , _ ) -> CEBool v | PInt ( n , _ ) -> CEInt n | PString ( s , _ ) -> CEString s | PReal ( v , Float , _ ) -> let s = Replacements . getRealToString p . repl ( Float . crop v ) " real " in CEF...
let getRecordField ( name : lhs_exp ) ( index : int ) ( typ : Typ . t option ) : lhs_exp = match name with | LId ( id , _ , attr ) -> let field = " field_ " ^ string_of_int index in LId ( id @ [ field ] , typ , { attr with typ } ) | _ -> failwith " ProgToCode . getRecordFiled : Invalid input "
let rec collectVarBind p stmts = match stmts with | [ ] -> [ ] | CSVar ( CLId ( _ , [ lhs ] ) , None ) :: CSBind ( CLId ( _ , [ lhs2 ] ) , rhs ) :: CSIf ( CEVar ( cond , _ ) , then_ , else_ ) :: t when lhs = cond && lhs2 = cond && cond . [ 0 ] = ' _ ' -> collectVarBind p ( CSIf ( rhs , then_ , else_ ) :: t ) | CSVar ( ...
let collectStmt ( p : parameters ) stmt = match stmt with | CSBlock stmts -> makeSingleBlock ( collectVarBind p stmts ) | _ -> stmt
let isSmall exp = match exp with | PInt ( i , _ ) when i < 1000 -> true | _ -> false
let removeFunction used = match used with | Keep _ -> false | _ -> true
let isRoot used = match used with | Keep Root | Used Root -> true | _ -> false
let refreshTable ( p : parameters ) = { p with variables = NameTable . make 1 }
let rec convertStmt ( p : parameters ) ( s : stmt ) : cstmt = match s with | StmtVal ( lhs , None , _ ) -> let lhs ' = convertLhsExp Declaration p lhs in CSVar ( lhs ' , None ) | StmtVal ( _ , _ , attr ) when p . cleanup && removeFunction attr . used -> CSEmpty | StmtVal ( lhs , Some rhs , _ ) -> let lhs ' = convertLhs...
let convert ( p : parameters ) ( stmts : stmt list ) : cstmt list = let cstmts = convertStmtList p stmts in cstmts
type app = { name : string ; internal_deps : item list ; findlib_deps : findlib_pkg list ; file : string ; install : [ ` No | ` Opam ] ; annot : unit option ; bin_annot : unit option ; cc : string option ; cclib : string option ; ccopt : string option ; color : [ ` auto | ` always | ` never ] option ; g : unit option ;...
type ' a with_options = ? annot : unit -> ? bin_annot : unit -> ? cc : string -> ? cclib : string -> ? ccopt : string -> ? color [ ` : auto | ` always | ` never ] -> ? g : unit -> ? inline : string -> ? inline_alloc_cost : string -> ? inline_branch_cost : string -> ? inline_branch_factor : string -> ? inline_call_cost ...
let lib ? annot ? bin_annot ? cc ? cclib ? ccopt ? color ? g ? inline ? inline_alloc_cost ? inline_branch_cost ? inline_branch_factor ? inline_call_cost ? inline_indirect_cost ? inline_lifting_benefit ? inline_max_depth ? inline_max_unroll ? inline_prim_cost ? inlining_report ? no_check_prims ? no_unbox_free_vars_of_cl...
let app ? annot ? bin_annot ? cc ? cclib ? ccopt ? color ? g ? inline ? inline_alloc_cost ? inline_branch_cost ? inline_branch_factor ? inline_call_cost ? inline_indirect_cost ? inline_lifting_benefit ? inline_max_depth ? inline_max_unroll ? inline_prim_cost ? inlining_report ? no_check_prims ? no_unbox_free_vars_of_cl...
let internal_deps = function | Lib x -> x . internal_deps | App x -> x . internal_deps
let findlib_deps = function | Lib x -> x . findlib_deps | App x -> x . findlib_deps
let internal_deps_all t = let count = ref 0 in let rec loop t = incr count ; if ! count > 10000 then failwith " max recursion count exceeded , likely cycle in internal_deps " else let direct = internal_deps t in let further = List . map direct ~ f : loop |> List . flatten in List . sort_uniq ~ cmp : compare ( direct @ ...
let findlib_deps_all t = let count = ref 0 in let rec loop t = incr count ; if ! count > 10000 then failwith " max recursion count exceeded , likely cycle in internal_deps " else let direct = findlib_deps t in let further = List . map ( internal_deps t ) ~ f : loop |> List . flatten in List . sort_uniq ~ cmp : String ....
let all_findlib_pkgs t = List . map t ~ f : findlib_deps |> List . flatten |> List . sort_uniq ~ cmp : String . compare
let name = function Lib x -> x . name | App x -> x . name
let is_lib = function Lib _ -> true | App _ -> false
let is_app = function App _ -> true | Lib _ -> false
let filter_libs t = List . filter_map t ~ f ( : function Lib x -> Some x | App _ -> None )
let filter_apps t = List . filter_map t ~ f ( : function App x -> Some x | Lib _ -> None )
let dep_opts_sat x optional_deps = let all_deps = findlib_deps_all x in List . for_all optional_deps ~ f ( : fun optional_dep -> not ( List . mem optional_dep ~ set : all_deps ) || Findlib . installed optional_dep )
let path_of_lib ~ suffix ( x : lib ) : string = sprintf " % s /% s % s " ( dirname x . dir ) x . name suffix
let path_of_pack ~ suffix ( x : lib ) : string = match x . style with | ` Basic -> failwithf " path_of_pack undefined for un - packed lib % s " x . name ( ) | ` Pack pack_name -> sprintf " % s /% s % s " ( dirname x . dir ) pack_name suffix
let path_of_app ~ suffix ( x : app ) : string = sprintf " % s /% s % s " ( dirname x . file ) x . name suffix
let file_base_of_module x = let ml_bases = List . map x . ml_files ~ f ( : fun y -> x . dir / y ) |> List . map ~ f ( : fun x -> chop_suffix x " . ml " ) in let mli_bases = List . map x . mli_files ~ f ( : fun y -> x . dir / y ) |> List . map ~ f ( : fun x -> chop_suffix x " . mli " ) in let bases = List . sort_uniq ~ ...
let module_paths ~ style_matters lib = let module_paths_orig = ( lib . ml_files @ lib . mli_files ) |> List . sort_uniq ~ cmp : String . compare |> List . map ~ f ( : fun x -> lib . dir ( / Filename . chop_extension x ) ) in match style_matters with | false -> module_paths_orig | true -> match lib . style with | ` Basi...
let module_dirs ~ style_matters lib = match style_matters , lib . style with | true , ` Pack _ -> [ dirname lib . dir ] | false , _ | true , ` Basic -> ( lib . ml_files @ lib . mli_files @ lib . c_files @ lib . h_files ) |> List . map ~ f : dirname |> List . sort_uniq ~ cmp : String . compare |> List . map ~ f ( : fun ...
let obj_suffix = function ` Byte -> " . cmo " | ` Native -> " . cmx "
let obj_suffixes = function ` Byte -> [ " . cmo " ] | ` Native -> [ " . cmx " ; " . o " ]
let lib_suffix = function ` Byte -> " . cma " | ` Native -> " . cmxa "
let exe_suffix = function ` Byte -> " . byte " | ` Native -> " . native "
let add_o_to_cmx l = let rec loop accum = function | [ ] -> accum | x :: l -> match String . chop_suffix x ~ suffix " . : cmx " with | None -> loop ( x :: accum ) l | Some base -> loop ( ( base " . ^ o " ) :: x :: accum ) l in loop [ ] l |> List . rev
let internal_deps_files mode x = internal_deps x |> List . map ~ f ( : function | Lib x -> path_of_lib x ~ suffix ( : lib_suffix mode ) | App x -> path_of_app x ~ suffix ( : exe_suffix mode ) )
module Item = struct type t = item type typ = [ ` Lib | ` App ] let typ = function Lib _ -> ` Lib | App _ -> ` App let typ_to_string = function ` Lib -> " lib " | ` App -> " app " let hash t = Hashtbl . hash ( typ t , name t ) let compare t u = match compare ( typ t ) ( typ u ) with | - 1 -> - 1 | 1 -> 1 | 0 -> String ...
module Graph = struct include Graph . Persistent . Digraph . Concrete ( Item ) module Dfs = Graph . Traverse . Dfs ( Graph . Persistent . Digraph . Concrete ( Item ) ) module Topological = struct include Graph . Topological . Make ( Graph . Persistent . Digraph . Concrete ( Item ) ) let sort g = fold ( fun x l -> x :: ...
type content = string list
let merlin_file ? safe_string ? short_paths ? strict_formats ? strict_sequence ? thread ? w ? warn_error items : string list = let pick ~ cmp l = let l ' = List . sort_uniq ~ cmp ( : Option . compare cmp ) l in match l ' with | [ ] -> None | [ x ] -> x | _ -> List . last_exn l in let safe_string : unit option = match s...
let meta_file ~ version libs : Fl_metascanner . pkg_expr option = let libs = List . filter libs ~ f ( : fun ( x : lib ) -> match x . install with ` Findlib _ -> true | ` No -> false ) in let findlib_pkg ( x : lib ) = match x . install with | ` Findlib x -> x | ` No -> assert false in let def ( ? preds [ ] ) = var value...
let build_meta_file items = filter_libs items |> meta_file ~ version " :< none " > |> Option . is_some
let install_file items : string list = let section name ( items : ( string * string option ) list ) : string list option = match items with | [ ] -> None | _ -> let items = List . map items ~ f ( : fun ( src , dst ) -> let src = Filename . normalize src in match dst with | None -> sprintf " " \% s " " \ src | Some dst ...
let ocamlinit_file ( ? postfix [ ] ) = items = let graph = Graph . of_list items in [ [ " let ( ) " ; = " try Topdirs . dir_directory ( Sys . getenv " \ OCAML_TOPLEVEL_PATH " ) " ; \ " with Not_found -> ( ) " ; " ; ; " ; " " ; ] ; [ " # use " \ topfind " ; ; " ; \ " # thread ; ; " ; " " ; ] ; ( let pkgs = " solvuu - bu...
let makefile ~ project_name items : string list = let default = [ " default : . merlin . ocamlinit byte " ] in let ln file = [ sprintf " % s : _build /% s " file file ; " \ tln - fs $< " ; $@ ] in let libs mode = filter_libs items |> List . map ~ f ( : fun x -> path_of_lib x ~ suffix ( : lib_suffix mode ) ) in let apps...
let build_ml_files_sorted mode build ~ package ml_files = let suffix = obj_suffix mode in let obj_files = run_ocamlfind_ocamldep_sort ~ package ml_files |> List . map ~ f ( : replace_suffix_exn ~ old " . : ml " ~ new_ : suffix ) in let ( ) = List . iter obj_files ~ f ( : fun x -> match build [ [ x ] ] with | [ Ocamlbui...
let build_deps_cmi_files build ~ pathI ~ package file_base_of_module file = run_ocamlfind_ocamldep1 ~ modules ( ) : ~ pathI ~ package file |> List . filter_map ~ f : file_base_of_module |> List . map ~ f ( : fun x -> [ x " . ^ cmi " ] ) |> build |> assert_all_outcomes |> ignore
let build_lib ( x : lib ) = let annot = x . annot in let bin_annot = x . bin_annot in let cc = x . cc in let cclib = x . cclib in let ccopt = x . ccopt in let color = x . color in let g = x . g in let inline = x . inline in let inline_alloc_cost = x . inline_alloc_cost in let inline_branch_cost = x . inline_branch_cost...
let build_app ( x : app ) = let annot = x . annot in let bin_annot = x . bin_annot in let cc = x . cc in let cclib = x . cclib in let ccopt = x . ccopt in let color = x . color in let g = x . g in let inline = x . inline in let inline_alloc_cost = x . inline_alloc_cost in let inline_branch_cost = x . inline_branch_cost...
let build_js_of_ocaml ? custom_header ? debug ? debug_info ? disable ? enable ? no_inline ? no_runtime ? o ? opt ? pretty ? set ? source_map_inline ? source_map_no_source ? source_map_root ? source_map ? extern_fs ? file ? pathI ? ofs ? linkall ? no_cmis ? toplevel ? extra_js ( item : item ) = let name = name item in l...
let build_static_file path build_content = let open Ocamlbuild_plugin in let open Util in let path = Filename . normalize path in Rule . rule ~ prods [ : path ] ( fun _ _ -> let content = build_content ( ) |> List . map ~ f ( : sprintf " % s \ n " ) in Seq [ Cmd ( Sh ( sprintf " mkdir - p % s " ( dirname path ) ) ) ; E...
let basic1 ( ? additional_rules [ ] ) = ( ? ocamlinit_postfix [ ] ) = ~ project_name ~ version items = ignore ( Graph . of_list items ) ; let libs = filter_libs items in let apps = filter_apps items in Ocamlbuild_plugin . dispatch @@ function | Ocamlbuild_plugin . After_rules -> ( Ocamlbuild_plugin . clear_rules ( ) ; ...
let solvuu1 ( ? additional_rules [ ] ) = ( ? ocamlinit_postfix [ ] ) = ~ project_name ~ version items = ignore ( Graph . of_list items ) ; let annot = Some ( ) in let bin_annot = Some ( ) in let g = Some ( ) in let safe_string = None in let short_paths = Some ( ) in let strict_sequence = Some ( ) in let thread = Some (...
type project_closure = { set_of_closures : Variable . t ; closure_id : Closure_id . t ; }
type move_within_set_of_closures = { closure : Variable . t ; start_from : Closure_id . t ; move_to : Closure_id . t ; }
type project_var = { closure : Variable . t ; closure_id : Closure_id . t ; var : Var_within_closure . t ; }
let compare_project_var ( { closure = closure1 ; closure_id = closure_id1 ; var = var1 ; } : project_var ) ( { closure = closure2 ; closure_id = closure_id2 ; var = var2 ; } : project_var ) = let c = Variable . compare closure1 closure2 in if c <> 0 then c else let c = Closure_id . compare closure_id1 closure_id2 in if...
let compare_move_within_set_of_closures ( { closure = closure1 ; start_from = start_from1 ; move_to = move_to1 ; } : move_within_set_of_closures ) ( { closure = closure2 ; start_from = start_from2 ; move_to = move_to2 ; } : move_within_set_of_closures ) = let c = Variable . compare closure1 closure2 in if c <> 0 then c...
let compare_project_closure ( { set_of_closures = set_of_closures1 ; closure_id = closure_id1 ; } : project_closure ) ( { set_of_closures = set_of_closures2 ; closure_id = closure_id2 ; } : project_closure ) = let c = Variable . compare set_of_closures1 set_of_closures2 in if c <> 0 then c else Closure_id . compare clo...
let print_project_closure ppf ( project_closure : project_closure ) = Format . fprintf ppf " [ @< 2 ( > project_closure @ % a @ from @ % a ) ] " @ Closure_id . print project_closure . closure_id Variable . print project_closure . set_of_closures
let print_move_within_set_of_closures ppf ( move_within_set_of_closures : move_within_set_of_closures ) = Format . fprintf ppf " [ @< 2 ( > move_within_set_of_closures @ % a <-- % a @ ( closure = % a ) ) ] " @ Closure_id . print move_within_set_of_closures . move_to Closure_id . print move_within_set_of_closures . star...
let print_project_var ppf ( project_var : project_var ) = Format . fprintf ppf " [ @< 2 ( > project_var @ % a @ from % a =% a ) ] " @ Var_within_closure . print project_var . var Closure_id . print project_var . closure_id Variable . print project_var . closure
type t = | Project_var of project_var | Project_closure of project_closure | Move_within_set_of_closures of move_within_set_of_closures | Field of int * Variable . t type nonrec t = t let compare t1 t2 = match t1 , t2 with | Project_var project_var1 , Project_var project_var2 -> compare_project_var project_var1 project...
let projecting_from t = match t with | Project_var { closure ; _ } -> closure | Project_closure { set_of_closures ; _ } -> set_of_closures | Move_within_set_of_closures { closure ; _ } -> closure | Field ( _ , var ) -> var
let map_projecting_from t ~ f : t = match t with | Project_var project_var -> let project_var : project_var = { project_var with closure = f project_var . closure ; } in Project_var project_var | Project_closure project_closure -> let project_closure : project_closure = { project_closure with set_of_closures = f projec...
let default_template = " < head > < meta charset " =\ utf - 8 " \> < title > <!-- set automatically , see soupault . conf --> </ title > < meta name " =\ viewport " \ content " =\ width = device - width , initial - scale = 1 " \> </ head > < body > <!-- your page content will be inserted here , see the default_content_...
let default_page = " < h1 > Welcome !</ h1 > "
let default_config = Printf . sprintf " [ settings ] # Soupalt version that the config was written / generated for # Trying to process this config with an older version will result in an error message soupault_version = " \% s " \ # Stop on page processing errors ? strict = true # Display progress ? verbose = true # Di...
let sample_config = " [ # preprocessors ] [ widgets . page - title ] widget = " \ title " \ selector = " \ h1 " \ default = " \ My Homepage " \ append = " \ & mdash ; My Homepage " \ # Insert a < title > in a page if it doesn ' t have one already . # By default soupault assumes if it ' s missing , you don ' t want it ....
let print_end_message settings = Printf . printf " Initialization complete .
let init settings = try print_endline " Initializing the project " ; if Config . config_exists Defaults . config_file then ( print_endline " Config file exists , not overwriting it " ) else ( default_config ^ " " ^ sample_config ) |> Soup . write_file Defaults . config_file ; if FileUtil . test ( FileUtil . Is_dir ) se...
let width = 125 in let box = GPack . vbox ? packing ~ spacing : 5 ( ) in let notebook = GPack . notebook ~ packing ( : box # pack ~ fill : true ~ expand : true ) ( ) in let gbox = GPack . vbox ~ border_width : 8 ~ spacing : 8 ( ) in let _ = notebook # append_page ~ tab_label ( : GMisc . label ~ text " : General " ( ) )...
let create ~ editor ? callback ? new_project ? page_num ? show ( ) = let project = match new_project with None -> editor # project | Some p -> p in let window = GWindow . window ~ modal : false ~ title ( " : Project " " \^ project . name " " " ) ^\ ~ icon : Icons . oe ~ border_width : 5 ~ position ` : CENTER ~ show : f...
let write proj = let open Prj in Xml . Element ( " project " , [ ] , [ Xml . Element ( " ocaml_home " , [ ] , [ Xml . PCData proj . ocaml_home ] ) ; Xml . Element ( " ocamllib " , [ ] , [ Xml . PCData ( if proj . ocamllib_from_env then proj . ocamllib else " " ) ] ) ; Xml . Element ( " encoding " , [ ] , [ Xml . PCData...
let value xml = try String . concat " \ n " ( List . map Xml . pcdata ( Xml . children xml ) ) with Xml . Not_element _ -> " " ; ;
let fold node tag f init = Xml . fold begin fun acc node -> if Xml . tag node = tag then f node else acc end init node ; ;
let attrib node name f default = match List_opt . assoc name ( Xml . attribs node ) with Some v -> f v | _ -> default ; ;
let fattrib node name f default = match List_opt . assoc name ( Xml . attribs node ) with Some v -> f v | _ -> ( default ( ) ) ; ;
let xml_bs_targets proj node = let open Prj in List . rev ( Xml . fold begin fun acc target_node -> try { Build_script . bst_target = ( match fattrib target_node " target_id " ( find_target_string proj ) ( fun _ -> None ) with Some x -> x | _ -> raise Exit ) ; bst_show = fattrib target_node " show " bool_of_string ( fu...
let xml_bs_args proj node = let open Prj in let count_bsa_id = ref 0 in Xml . map begin fun arg -> let bsa_doc = ref " " in let bsa_mode = ref ` add in let bsa_default_override = ref true in let bsa_default = ref ( ` flag false ) in let bsa_task = ref ( None , None ) in Xml . iter begin fun tp -> match Xml . tag tp wit...
let xml_commands proj node = let open Prj in List . rev ( Xml . fold begin fun acc target_node -> try { Build_script . bsc_name = ( fattrib target_node " name " Build_script . command_of_string ( fun _ -> raise Exit ) ) ; bsc_descr = ( attrib target_node " descr " ( fun x -> x ) " " ) ; bsc_target = ( match fattrib tar...
let read filename = let open Prj in let proj = create ~ filename ( ) in let parser = XmlParser . make ( ) in let xml = XmlParser . parse parser ( XmlParser . SFile filename ) in let get_offset xml = try int_of_string ( Xml . attrib xml " offset " ) with Xml . No_attribute _ -> 0 in let get_active xml = try bool_of_stri...
let from_local_xml proj = let open Prj in let filename = Project . filename_local proj in let filename = if Sys . file_exists filename then filename else Project . mk_old_filename_local proj in if Sys . file_exists filename then begin let parser = XmlParser . make ( ) in let xml = XmlParser . parse parser ( XmlParser ....
let init ( ) = Project . write_xml := write ; Project . read_xml := read ; Project . from_local_xml := from_local_xml ;