text stringlengths 12 786k |
|---|
module B = struct open Camlp4 open PreCast . Syntax open PreCast open Format module CleanAst = Camlp4 . Struct . CleanAst . Make ( Ast ) module SSet = Set . Make ( String ) let pa_r = " Camlp4OCamlRevisedParser " let pa_rr = " Camlp4OCamlReloadedParser " let pa_o = " Camlp4OCamlParser ... |
module Id = struct value name = " Camlp4DebugParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; module StringSet = Set . Make String ; value debug_mode = try let str = Sys . getenv " STATIC_CAMLP4_DEBUG " in let rec loop acc i = try let pos = String . index_from str i ' ' : in loop ( StringSet . ... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module Id = struct value name = " Camlp4ExceptionTracer " ; value version = Sys . ocaml_version ; end ; |
module Make ( AstFilters : Camlp4 . Sig . AstFilters ) = struct open AstFilters ; open Ast ; value add_debug_expr e = let _loc = Ast . loc_of_expr e in let msg = " camlp4 - debug : exc : % s at " ^ Loc . to_string _loc ^ " . " @ in <: expr < try $ e $ with [ Stream . Fail... |
let module M = Camlp4 . Register . AstFilter Id Make in ( ) ; |
module Id = struct value name = " Camlp4FoldGenerator " ; value version = Sys . ocaml_version ; end ; |
module Make ( AstFilters : Camlp4 . Sig . AstFilters ) = struct open AstFilters ; module StringMap = Map . Make String ; open Ast ; value _loc = Loc . ghost ; value sf = Printf . sprintf ; value xik i k = let i = if i < 0 then assert False else if i = 0 then " " else sf " _i ... |
let module M = Camlp4 . Register . AstFilter Id Make in ( ) ; |
module Id = struct value name = " Camlp4GrammarParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; module MetaLoc = Ast . Meta . MetaGhostLoc ; module MetaAst = Ast . Meta . Make MetaLoc ; module PP = Camlp4 . Printers . OCaml . Make Syntax ; value pp = new PP . printer ~ comments : False ( ) ... |
module M = Register . OCamlSyntaxExtension Id Make ; |
module Id = struct value name = " Camlp4ListComprehension " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; value rec loop n = fun [ [ ] -> None | [ ( x , _ ) ] -> if n = 1 then Some x else None | [ _ :: l ] -> loop ( n - 1 ) l ] ; value stream_peek_nth n strm = loop n ( Stream . npeek n ... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module Id = struct value name = " Camlp4MacroParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; type item_or_def ' a = [ SdStr of ' a | SdDef of string and option ( list string * Ast . expr ) | SdUnd of string | SdITE of bool and list ( item_or_def ' a ) and list ( item_or_def ' a ) | SdLazy ... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module MakeNothing ( AstFilters : Camlp4 . Sig . AstFilters ) = struct open AstFilters ; open Ast ; value remove_nothings = fun [ <: expr < $ e $ NOTHING >> | <: expr < fun $ <: patt < NOTHING >> $ -> $ e $ >> -> e | e -> e ] ; register_str_item_filter ( Ast . map_expr remov... |
let module M = Camlp4 . Register . AstFilter Id MakeNothing in ( ) ; |
module MapTy = Map . Make String ; |
type t = { name : Ast . ident ; type_decls : MapTy . t Ast . ctyp ; acc : Ast . expr ; app : Ast . expr ; id : Ast . expr ; tup : Ast . expr ; com : Ast . expr ; str : Ast . expr ; int : Ast . expr ; flo : Ast . expr ; chr : Ast . expr ; ant : Ast . ident ;... |
module Id : Sig . Id = struct value name = " Camlp4OCamlParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; Camlp4_config . constructors_arity . val := False ; value bigarray_set _loc var newval = match var with [ <: expr < Bigarray . Array1 . get $ arr $ $ c1 $ >> -> Some <: expr < Bigarray . Array1 . se... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module Id : Sig . Id = struct value name = " Camlp4OCamlParserParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; module M = Camlp4OCamlRevisedParserParser . Make Syntax ; open M ; Gram . Entry . clear stream_expr ; Gram . Entry . clear stream_begin ; Gram . Entry . clear stream_end ; Gram . Entry . clear strea... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module Id = struct value name = " Camlp4Reloaded " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; Gram . Entry . clear match_case ; Gram . Entry . clear semi ; value mkseq _loc = fun [ <: expr < $ _ ; $ $ _ $ >> as e -> <: expr < do { $ e $ } >> | e -> e ] ; DELETE_RULE Gram match_... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module Id = struct value name = " Camlp4OCamlRevisedParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; Camlp4_config . constructors_arity . val := False ; value help_sequences ( ) = do { Printf . eprintf " \ \ n " ; flush stderr ; exit 1 } ; Options . add " - help_seq " ( Arg . Unit help... |
let module M = Register . OCamlSyntaxExtension Id Make in ( ) ; |
module Id : Sig . Id = struct value name = " Camlp4OCamlRevisedParserParser " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig ; include Syntax ; type spat_comp = [ SpTrm of Loc . t and Ast . patt and option Ast . expr | SpNtr of Loc . t and Ast . patt and Ast . expr | SpStr of Loc . t and Ast . patt ] ; type sexp_comp = [ SeTrm of Loc . t a... |
module M = Register . OCamlSyntaxExtension Id Make ; |
module Id = struct value name = " Camlp4Profiler " ; value version = Sys . ocaml_version ; end ; |
module Make ( AstFilters : Camlp4 . Sig . AstFilters ) = struct open AstFilters ; open Ast ; value decorate_binding decorate_fun = object inherit Ast . map as super ; method binding = fun [ <: binding @ _loc < $ lid : id $ = ( $<: expr < fun [ $ _ $ ] >> as e ) $ >> -> <:... |
let module M = Camlp4 . Register . AstFilter Id Make in ( ) ; |
module Id = struct value name = " Camlp4QuotationCommon " ; value version = Sys . ocaml_version ; end ; |
module Make ( Syntax : Sig . Camlp4Syntax ) ( TheAntiquotSyntax : ( Sig . Parser Syntax . Ast ) . SIMPLE ) open Sig ; include Syntax ; module MetaLocHere = Ast . Meta . MetaLoc ; module MetaLoc = struct module Ast = Ast ; value loc_name = ref None ; value meta_loc_expr _loc loc ... |
module Widget = struct include Rawwidget type widget = raw_any raw_widget let default_toplevel = coe default_toplevel end |
module Protocol = struct open Widget include Protocol let opentk ( ) = coe ( opentk ( ) ) let opentk_with_args args = coe ( opentk_with_args args ) let openTk ? display ? clas ( ) = coe ( openTk ? display ? clas ( ) ) let cCAMLtoTKwidget table w = Widget . check_class w table ; ... |
module Textvariable = struct open Textvariable type textVariable = Textvariable . textVariable let create = create let set = set let get = get let name = name let cCAMLtoTKtextVariable = cCAMLtoTKtextVariable let handle tv cbk = handle tv ~ callback : cbk let coerce = coerce let free = free let create_tem... |
module Fileevent = struct open Fileevent let add_fileinput fd callback = add_fileinput ~ fd ~ callback let remove_fileinput fd = remove_fileinput ~ fd let add_fileoutput fd callback = add_fileoutput ~ fd ~ callback let remove_fileoutput fd = remove_fileoutput ~ fd end |
module Timer = struct open Timer type t = Timer . t let add ms callback = add ~ ms ~ callback let set ms callback = set ~ ms ~ callback let remove = remove end |
let bind widget tag eventsequence action = tkCommand [ | cCAMLtoTKwidget widget_canvas_table widget ; TkToken " bind " ; cCAMLtoTKtagOrId tag ; cCAMLtoTKeventSequence eventsequence ; begin match action with | BindRemove -> TkToken " " | BindSet ( what , f ) -> let cbId = register_callback... |
let bind ~ events ( ? extend = false ) ( ? breakable = false ) ( ? fields = [ ] ) ? action widget tag = tkCommand [ | cCAMLtoTKwidget widget ; TkToken " bind " ; cCAMLtoTKtagOrId tag ; cCAMLtoTKeventSequence events ; begin match action with None -> TkToken " " | Some f -> ... |
let packages = [ ( " 0install - solver " , " 2 . 17 " ) ; ( " afl - persistent " , " 1 . 3 " ) ; ( " alcotest " , " 1 . 4 . 0 " ) ; ( " astring " , " 0 . 8 . 5 " ) ; ( " base " , " v0 . 14 . 0 " ) ; ( " ... |
let setup_logs ( ) = let reporter = Progress . logs_reporter ( ) in Fmt_tty . setup_std_outputs ( ) ; Logs_threaded . enable ( ) ; Logs . set_reporter reporter |
let bar = let open Progress . Line in let total = Vector . length packages in list [ constf " % a " Fmt . ( styled ` Cyan string ) " Building " ; using fst ( brackets ( bar ~ style ( ` : Custom ( Bar_style . v [ " " ; = " " ; > " " ] ) ) ~ width ( ` ... |
let rec package_worker ( active_packages , reporter ) = match Vector . pop packages with | exception Vector . Empty -> ( ) | package , version -> active_packages := package :: ! active_packages ; Logs . app ( fun f -> f " % a % s % s " Fmt . ( styled ` Green string ) " Co... |
let run ( ) = setup_logs ( ) ; Random . self_init ( ) ; let cpus = 4 in let run_duration = Mtime_clock . counter ( ) in let active_packages = ref [ ] in Progress . with_reporter ~ config ( : Progress . Config . v ~ persistent : false ( ) ) bar ( fun reporter -> let ... |
let command cmdline = if ! Clflags . verbose then begin prerr_string " + " ; prerr_string cmdline ; prerr_newline ( ) end ; Sys . command cmdline |
let run_command cmdline = ignore ( command cmdline ) |
let build_diversion lst = let ( responsefile , oc ) = Filename . open_temp_file " camlresp " " " in List . iter ( fun f -> Printf . fprintf oc " % s \ n " f ) lst ; close_out oc ; at_exit ( fun ( ) -> Misc . remove_file responsefile ) ; " " @ ^ responsefile |
let quote_files lst = let lst = List . filter ( fun f -> f <> " " ) lst in let quoted = List . map Filename . quote lst in let s = String . concat " " quoted in if String . length s >= 4096 && Sys . os_type = " Win32 " then build_diversion quoted else s |
let quote_prefixed pr lst = let lst = List . filter ( fun f -> f <> " " ) lst in let lst = List . map ( fun f -> pr ^ f ) lst in quote_files lst |
let quote_optfile = function | None -> " " | Some f -> Filename . quote f |
let compile_file name = command ( Printf . sprintf " % s - c % s % s % s % s " ( match ! Clflags . c_compiler with | Some cc -> cc | None -> if ! Clflags . native_code then Config . native_c_compiler else Config . bytecomp_c_compiler ) ( String . concat " " ( List . rev ! C... |
let create_archive archive file_list = Misc . remove_file archive ; let quoted_archive = Filename . quote archive in match Config . ccomp_type with " msvc " -> command ( Printf . sprintf " link / lib / nologo / out :% s % s " quoted_archive ( quote_files file_list ) ) | _ -> let r1 ... |
let expand_libname name = if String . length name < 2 || String . sub name 0 2 <> " - l " then name else begin let libname = " lib " ^ String . sub name 2 ( String . length name - 2 ) ^ Config . ext_lib in try Misc . find_in_path ! Config . load_path libname with Not_found -> l... |
type link_mode = | Exe | Dll | MainDll | Partial |
let call_linker mode output_name files extra = let files = quote_files files in let asmrun = " ' " ^ Config . standard_library ^ " / libasmrun . a ' " in let cmd = if mode = Partial then Printf . sprintf " % s % s % s % s " Config . native_pack_linker ( Filename . quote output_na... |
type os = Linux | OSX | Windows | Other |
let os = match Sys . os_type with | " Win32 " | " Cygwin " -> Windows | " Unix " -> ( try let in_channel = Unix . open_process_in " uname - s " in let os = try match input_line in_channel with | " Linux " -> Linux | " Darwin " -> OSX | _ -> Other with End_of_file -> Other ... |
let is_unix = match os with | Linux | OSX | Other -> true | Windows -> false |
let ( / ) = Filename . concat |
let program_dir = let dir = Filename . dirname Sys . executable_name in if Filename . is_relative dir then Sys . getcwd ( ) / dir else dir |
let datadir = let default = if is_unix && Filename . basename program_dir = " bin " then Filename . dirname program_dir / " share " / " ocaml - top " else program_dir / " data " in let default = if Sys . file_exists default && Sys . is_directory default then default else Sys . getcwd... |
let font = ref ( match os with | Linux | Other -> " DejaVu Sans Mono 10 " | OSX -> " Monaco 12 " | Windows -> " Lucida Console 10 " ) |
let char_width = ref 8 |
let theme = ref " dark " |
let ocaml_cmd , ocaml_opts , stdlib_dir = if Sys . os_type <> " Win32 " then ref " ocaml " , ref [ ] , None else if Sys . command " ocamlrun ocaml - vnum " = 0 then ref " ocamlrun " , ref [ " ocaml " ] , None else ref ( program_dir / " bin " / " ocamlrun " ) ... |
module State : sig type t val make : fun_name : string -> tailrec_label : Label . t -> contains_calls : bool -> Cfg . basic_block Label . Tbl . t -> t val get_fun_name : t -> string val get_tailrec_label : t -> Label . t val get_contains_calls : t -> bool val add_block : t -> label : Label .... |
type basic_or_terminator = | Basic of Cfg . basic | Terminator of Cfg . terminator |
let basic_or_terminator_of_operation : State . t -> Mach . operation -> basic_or_terminator = fun state op -> match op with | Imove -> Basic ( Op Move ) | Ispill -> Basic ( Op Spill ) | Ireload -> Basic ( Op Reload ) | Iconst_int i -> Basic ( Op ( Const_int i ) ) | Iconst_float f ... |
let float_test_of_float_comparison : Cmm . float_comparison -> label_false : Label . t -> label_true : Label . t -> Cfg . float_test = fun comparison ~ label_false ~ label_true -> let lt , eq , gt , uo = match comparison with | CFeq -> label_false , label_true , label_false , label_fals... |
let int_test_of_integer_comparison : Cmm . integer_comparison -> signed : bool -> immediate : int option -> label_false : Label . t -> label_true : Label . t -> Cfg . int_test = fun comparison ~ signed : is_signed ~ immediate : imm ~ label_false ~ label_true -> let lt , eq , gt = match co... |
let terminator_of_test : Mach . test -> label_false : Label . t -> label_true : Label . t -> Cfg . terminator = fun test ~ label_false ~ label_true -> let int_test comparison immediate = let signed , comparison = match comparison with | Mach . Isigned comparison -> true , comparison | Mach ... |
let make_instruction : type a . State . t -> desc : a -> a Cfg . instruction = fun state ~ desc -> let arg = [ ] || in let res = [ ] || in let dbg = Debuginfo . none in let live = Reg . Set . empty in let stack_offset = invalid_stack_offset in let id = State . get_next_instruction_i... |
let copy_instruction : type a . State . t -> Mach . instruction -> desc : a -> a Cfg . instruction = fun state instr ~ desc -> let { Mach . arg ; res ; dbg ; live ; desc = _ ; next = _ ; available_before = _ ; available_across = _ } = instr in let stack_offset = invalid_sta... |
let copy_instruction_no_reg : type a . State . t -> Mach . instruction -> desc : a -> a Cfg . instruction = fun state instr ~ desc -> let { Mach . arg = _ ; res = _ ; dbg ; live ; desc = _ ; next = _ ; available_before = _ ; available_across = _ } = instr in let arg = [... |
let rec get_end : Mach . instruction -> Mach . instruction = fun instr -> match instr . Mach . desc with | Iend -> instr | Iop _ | Ireturn _ | Iifthenelse _ | Iswitch _ | Icatch _ | Iexit _ | Itrywith _ | Iraise _ -> get_end instr . Mach . next |
type block_info = { instrs : Cfg . basic Cfg . instruction list ; last : Mach . instruction ; terminator : Cfg . terminator Cfg . instruction option } |
let extract_block_info : State . t -> Mach . instruction -> block_info = fun state first -> let rec loop ( instr : Mach . instruction ) acc = let return terminator instrs = let instrs = List . rev instrs in { instrs ; last = instr ; terminator } in match instr . desc with | Iop op -> b... |
let fallthrough_label : Label . t = - 1 |
let rec add_blocks : Mach . instruction -> State . t -> starts_with_pushtrap : Label . t option -> start : Label . t -> next : Label . t -> unit = fun instr state ~ starts_with_pushtrap ~ start ~ next -> let { instrs ; last ; terminator } = extract_block_info state instr in let terminat... |
let update_trap_handler_blocks : State . t -> Cfg . t -> unit = fun state cfg -> List . iter ( fun label -> match Label . Tbl . find_opt cfg . blocks label with | None -> Misc . fatal_errorf " Cfgize . update_trap_handler_blocks : inconsistent state ( no block \ labelled % d ) " lab... |
module Stack_offset_and_exn = struct type handler_stack = Label . t list let compute_stack_offset ~ stack_offset ~ traps = stack_offset + ( Proc . trap_size_in_bytes * List . length traps ) let check_and_set_stack_offset : ' a Cfg . instruction -> stack_offset : int -> traps : handler_stack -... |
let fundecl : Mach . fundecl -> preserve_orig_labels : bool -> simplify_terminators : bool -> Cfg_with_layout . t = fun fundecl ~ preserve_orig_labels ~ simplify_terminators -> let { Mach . fun_name ; fun_args ; fun_body ; fun_codegen_options ; fun_dbg ; fun_num_stack_slots ; fun_contains_... |
module type Forward_domain = sig type t val top : t val bot : t val compare : t -> t -> int val join : t -> t -> t val to_string : t -> string end |
module type Forward_transfer = sig type domain type t = { normal : domain ; exceptional : domain } val basic : domain -> Cfg . basic Cfg . instruction -> t val terminator : domain -> Cfg . terminator Cfg . instruction -> t end |
module type Forward_S = sig type domain type map = domain Label . Tbl . t val run : Cfg . t -> ? max_iteration : int -> ? init : domain -> unit -> ( map , map ) Result . t end |
module Forward ( D : Forward_domain ) ( T : Forward_transfer with type domain = D . t ) : Forward_S with type domain = D . t = struct type domain = D . t type transfer = T . t type map = domain Label . Tbl . t module WorkSetElement = struct type t = { label : Label . t ; value : d... |
module type Backward_domain = sig type t val bot : t val compare : t -> t -> int val join : t -> t -> t val less_equal : t -> t -> bool val to_string : t -> string end |
module type Backward_transfer = sig type domain val basic : domain -> exn : domain -> Cfg . basic Cfg . instruction -> domain val terminator : domain -> exn : domain -> Cfg . terminator Cfg . instruction -> domain val exception_ : domain -> domain end |
module type Backward_S = sig type domain type _ map = | Block : domain Label . Tbl . t map | Instr : domain Instr . Tbl . t map val run : Cfg . t -> ? max_iteration : int -> init : domain -> map ' : a map -> unit -> ( ' a , ' a ) Result . t end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.