text stringlengths 0 601k |
|---|
type stats = { classes : int ; methods : int ; inst_vars : int ; } |
let stats ( ) = { classes = ! table_count ; methods = ! method_count ; inst_vars = ! inst_var_count ; } |
module Debug : sig type section = string val mode : section -> bool val printf : section -> ( ' a , Format . formatter , unit ) format -> ' a end = struct open Format module Debug = struct let mode _ = false end type section = string let out_channel = try let f = Sys . getenv " CAMLP4_DEBUG_FILE " in open_out_gen [ Ope... |
module Options : sig type spec_list = ( string * Arg . spec * string ) list val init : spec_list -> unit val add : string -> Arg . spec -> string -> unit val print_usage_list : spec_list -> unit val ext_spec_list : unit -> spec_list val parse : ( string -> unit ) -> string array -> string list end = struct type spec_li... |
module Sig = struct module type Type = sig type t end module type Error = sig type t exception E of t val to_string : t -> string val print : Format . formatter -> t -> unit end module type Id = sig val name : string val version : string end module Warning ( Loc : Type ) = struct module type S = sig type warning = Loc ... |
module ErrorHandler : sig val print : Format . formatter -> exn -> unit val try_print : Format . formatter -> exn -> unit val to_string : exn -> string val try_to_string : exn -> string val register : ( Format . formatter -> exn -> unit ) -> unit module Register ( Error : Sig . Error ) : sig end module ObjTools : sig v... |
module Struct = struct module Loc : sig include Sig . Loc end = struct open Format type pos = { line : int ; bol : int ; off : int } type t = { file_name : string ; start : pos ; stop : pos ; ghost : bool } let dump_sel f x = let s = match x with | ` start -> " ` start " | ` stop -> " ` stop " | ` both -> " ` both " | ... |
module Printers = struct module DumpCamlp4Ast : sig module Id : Sig . Id module Make ( Syntax : Sig . Syntax ) : Sig . Printer ( Syntax . Ast ) . S end = struct module Id = struct let name = " Camlp4Printers . DumpCamlp4Ast " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Syntax ) : Sig . Printer ( ... |
module OCamlInitSyntax = struct module Make ( Ast : Sig . Camlp4Ast ) ( Gram : Sig . Grammar . Static with module Loc = Ast . Loc with type Token . t = Sig . camlp4_token ) ( Quotation : Sig . Quotation with module Ast = Sig . Camlp4AstToAst ( Ast ) ) : Sig . Camlp4Syntax with module Loc = Ast . Loc and module Ast = As... |
module PreCast : sig type camlp4_token = Sig . camlp4_token = | KEYWORD of string | SYMBOL of string | LIDENT of string | UIDENT of string | ESCAPED_IDENT of string | INT of int * string | INT32 of int32 * string | INT64 of int64 * string | NATIVEINT of nativeint * string | FLOAT of float * string | CHAR of char * stri... |
module Register : sig module Plugin ( Id : Sig . Id ) ( Plugin : functor ( Unit : sig end ) -> sig end ) : sig end module SyntaxPlugin ( Id : Sig . Id ) ( SyntaxPlugin : functor ( Syn : Sig . Syntax ) -> sig end ) : sig end module SyntaxExtension ( Id : Sig . Id ) ( SyntaxExtension : Sig . SyntaxExtension ) : sig end m... |
module Make ( Loc : Sig . Loc ) : Sig . Camlp4Ast with module Loc = Loc = struct module Loc = Loc ; module Ast = struct include ( Sig . MakeCamlp4Ast Loc ) ; value safe_string_escaped s = if ( ( String . length s ) > 2 ) && ( ( s . [ 0 ] = ' ' ) \\ && ( s . [ 1 ] = ' ' ) ) $ then s else String . escaped s ; end ; inclu... |
type loc = Loc . t and meta_bool = [ BTrue | BFalse | BAnt of string ] and rec_flag = [ ReRecursive | ReNil | ReAnt of string ] and direction_flag = [ DiTo | DiDownto | DiAnt of string ] and mutable_flag = [ MuMutable | MuNil | MuAnt of string ] and private_flag = [ PrPrivate | PrNil | PrAnt of string ] and virtual_fla... |
module Make ( Ast : Sig . Camlp4Ast ) = struct open Format ; open Camlp4_import . Parsetree ; open Camlp4_import . Longident ; open Camlp4_import . Asttypes ; open Ast ; value constructors_arity ( ) = debug ast2pt " constructors_arity : % b . " @ Camlp4_config . constructors_arity . val in Camlp4_config . constructors_... |
module CleanAst = Camlp4 . Struct . CleanAst . Make Ast ; |
module SSet = Set . Make String ; loaded_modules . val := SSet . add name loaded_modules . val ; if DynLoader . is_native then ( " . cmxs " , " . cmxs " ) else ( " . cmo " , " . cma " ) ; let dyn_loader = dyn_loader . val ( ) in let find_in_path = DynLoader . find_in_path dyn_loader in let real_load name = do { add_to_... |
type file_kind = [ Intf of string | Impl of string | Str of string | ModuleImpl of string | IncludeDir of string ] ; let t = ref None in let task f x = let ( ) = Camlp4_config . current_input_file . val := x in t . val := Some ( if t . val = None then ( fun _ -> f x ) else ( fun usage -> usage ( ) ) ) in let do_task us... |
module R = struct open Camlp4 module Id = struct let name = " Camlp4OCamlRevisedParser " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig include Syntax let _ = Camlp4_config . constructors_arity := false let help_sequences ( ) = ( Printf . eprintf " \ \ n " ; flush st... |
module Camlp4QuotationCommon = struct open Camlp4 module Id = struct let name = " Camlp4QuotationCommon " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Camlp4Syntax ) ( TheAntiquotSyntax : Sig . Parser ( Syntax . Ast ) . SIMPLE ) = struct open Sig include Syntax module MetaLocHere = Ast . Meta . Me... |
module Q = struct open Camlp4 module Id = struct let name = " Camlp4QuotationExpander " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Camlp4Syntax ) = struct module M = Camlp4QuotationCommon . Make ( Syntax ) ( Syntax . AntiquotSyntax ) include M end let _ = let module M = Register . OCamlSyntaxExt... |
module Rp = struct open Camlp4 module Id : Sig . Id = struct let name = " Camlp4OCamlRevisedParserParser " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig include Syntax type spat_comp = | SpTrm of Loc . t * Ast . patt * Ast . expr option | SpNtr of Loc . t * Ast . pa... |
module G = struct open Camlp4 module Id = struct let name = " Camlp4GrammarParser " let 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 .... |
module M = struct open Camlp4 module Id = struct let name = " Camlp4MacroParser " let version = Sys . ocaml_version end open Camlp4 module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig include Syntax type ' a item_or_def = | SdStr of ' a | SdDef of string * ( ( string list ) * Ast . expr ) option | SdUnd of st... |
module D = struct open Camlp4 module Id = struct let name = " Camlp4DebugParser " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig include Syntax module StringSet = Set . Make ( String ) let debug_mode = try let str = Sys . getenv " STATIC_CAMLP4_DEBUG " in let rec loo... |
module L = struct open Camlp4 module Id = struct let name = " Camlp4ListComprehension " let version = Sys . ocaml_version end module Make ( Syntax : Sig . Camlp4Syntax ) = struct open Sig include Syntax let rec loop n = function | [ ] -> None | [ ( x , _ ) ] -> if n = 1 then Some x else None | _ :: l -> loop ( n - 1 ) ... |
module P = struct let _ = Camlp4 . Register . enable_dump_ocaml_ast_printer ( ) end |
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 " let pa_rp = " Camlp4OCamlRevised... |
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 . add ( String . sub str i ( pos - i ) )... |
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 . Failure | Exit as exc -> raise exc | exc -> do { if ... |
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 % d " i in let k = if k < 1 then assert Fals... |
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 ( ) ; value string_of_patt patt = let buf = Buff... |
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 strm ) ; value test_patt_lessminus = Gram . Entry . of_par... |
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 of Lazy . t ' a ] ; value rec list_remove ... |
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 remove_nothings ) # str_item ; end ; |
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 ; } ; fun [ <: ident < $ lid : s $ >> -> s | <: ident < $ uid : ... |
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 . set $ arr $ $ c1 $ $ newval $ >> | <: expr ... |
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 stream_quot ; Gram . Entry . clear parser_case... |
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_case0 : patt_as_patt_opt ; opt_when_expr ; " " ; -> exp... |
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_sequences ) " Print explanations about new sequences ... |
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 and Ast . expr | SeNtr of Loc . t and Ast .... |
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 ) $ >> -> <: binding < $ lid : id $ = $ decorate_fun id 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 = match loc_name . val with [ None -> <: ... |
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 ; TkToken ( Widget . name w ) let openTkCla... |
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_temporary w = cre... |
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 widget ( wrapeventInfo f what ... |
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 cbId = register_callback widget ~ callback ... |
let packages = [ ( " 0install - solver " , " 2 . 17 " ) ; ( " afl - persistent " , " 1 . 3 " ) ; ( " alcotest " , " 1 . 4 . 0 " ) ; ( " astring " , " 0 . 8 . 5 " ) ; ( " base " , " v0 . 14 . 0 " ) ; ( " bechamel " , " 0 . 1 . 0 " ) ; ( " bos " , " 0 . 2 . 0 " ) ; ( " cmdliner " , " 1 . 0 . 4 " ) ; ( " cohttp " , " 4 . ... |
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 ( ` : Fixed 40 ) total ) ) ; ticker_to total ; using snd string ] |
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 ) " Compiling " package version ) ; Unix . sleepf ( Ra... |
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 reporter ( ) = let package_list = ! active_packages |>... |
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 ! Clflags . ccopts ) ) ( quote_prefixed " - I " (... |
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 = command ( Printf . sprintf " ar rc ... |
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 -> libname end |
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_name ) files extra else Printf . sprintf "... |
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 in ignore ( Unix . close_process_in in_channel ... |
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 ( ) / " data " in ref default |
let font = ref ( match os with | Linux | Other -> " DejaVu Sans Mono 10 " | OSX -> " Monaco 12 " | Windows -> " Lucida Console 10 " ) |
let char_width = ref 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.