text stringlengths 0 601k |
|---|
module Message = struct let network_id_mainnet = Char . of_int_exn 1 let network_id_testnet = Char . of_int_exn 0 let network_id = match Mina_signature_kind . t with | Mainnet -> network_id_mainnet | Testnet -> network_id_testnet module Legacy = struct open Tick type t = ( Field . t , bool ) bool Random_oracle . Input ... |
module Legacy = Make ( Tick ) Tick ( Tick . Inner_curve ) Inner_curve ( Message . Legacy ) Legacy |
module Chunked = Make ( Tick ) Tick ( Tick . Inner_curve ) Inner_curve ( Message . Chunked ) Chunked |
let gen_legacy = let open Quickcheck . Let_syntax in let % map pk = Private_key . gen and msg = Tick . Field . gen in ( pk , Random_oracle . Input . Legacy . field_elements [ | msg ] ) | |
let gen_chunked = let open Quickcheck . Let_syntax in let % map pk = Private_key . gen and msg = Tick . Field . gen in ( pk , Random_oracle . Input . Chunked . field_elements [ | msg ] ) | |
let legacy_message_typ ( ) : ( Message . Legacy . var , Message . Legacy . t ) t Tick . Typ . t = let to_hlist { Random_oracle . Input . Legacy . field_elements ; bitstrings } = H_list [ . field_elements ; bitstrings ] in let of_hlist ( [ field_elements ; bitstrings ] : ( unit , _ ) _ H_list . t ) t = { Random_oracle .... |
let chunked_message_typ ( ) : ( Message . Chunked . var , Message . Chunked . t ) t Tick . Typ . t = let open Tick . Typ in let const_typ = Typ { check = ( fun _ -> Tick . Checked . return ( ) ) ; var_to_fields = ( fun t -> ( [ ] , || t ) t ) t ; var_of_fields = ( fun ( _ , t ) t -> t ) t ; value_to_fields = ( fun t ->... |
module Numpy = struct let transpose x = let npy_transpose = Py . Module . get_function ( Pyinit . numpy ( ) ) " transpose " in npy_transpose [ | x ] | end |
module LinearModel = struct let assert_matrix_nontrivial ( m : Matrix . t ) = let ( l , c ) = Matrix . shape m in assert ( l <> 0 && c <> 0 ) let ridge ( ~ alpha : float ) ( ? fit_intercept : bool = false ) ( ? normalize : bool = false ) ( ~ input : Matrix . t ) ( ~ output : Matrix . t ) ( ) = assert_matrix_nontrivial ... |
module Binding = struct module Kind = struct module Star = struct type t = | Once | Twice [ @@ deriving sexp , compare , hash ] end module Import = struct type t = | From of Reference . t | Module [ @@ deriving sexp , compare , hash ] end type t = | AssignTarget of Expression . t option | ClassName | ComprehensionTarge... |
let rec globals_of_statement sofar { Node . value ; _ } = let open Statement in match value with | Statement . Global globals -> List . rev_append globals sofar | For { For . body ; orelse ; _ } | If { If . body ; orelse ; _ } | While { While . body ; orelse ; _ } -> let sofar = globals_of_statements sofar body in glob... |
let rec nonlocals_of_statement sofar { Node . value ; _ } = let open Statement in match value with | Statement . Nonlocal nonlocals -> List . rev_append nonlocals sofar | For { For . body ; orelse ; _ } | If { If . body ; orelse ; _ } | While { While . body ; orelse ; _ } -> let sofar = nonlocals_of_statements sofar bo... |
module Scope = struct module Kind = struct type t = | Module | Define of Statement . Define . Signature . t | Lambda | Comprehension [ @@ deriving sexp , compare , hash ] end type t = { kind : Kind . t ; globals : Identifier . Set . t ; nonlocals : Identifier . Set . t ; bindings : Binding . t Identifier . Map . t ; } ... |
module Access = struct module Locality = struct type t = | Local | Nonlocal | Global [ @@ deriving sexp , compare , hash ] end module Kind = struct type t = | CurrentScope | OuterScope of Locality . t [ @@ deriving sexp , compare , hash ] end type t = { kind : Kind . t ; binding : Binding . t ; scope : Scope . t ; } [ ... |
module ScopeStack = struct type t = { global : Scope . t ; locals : Scope . t list ; } let create source = { global = Scope . of_source source ; locals = [ ] } let global_scope { global ; _ } = global let current_scope { locals ; global } = match locals with | [ ] -> global | scope :: _ -> scope let lookup { locals ; g... |
module Builtins = struct let mem = function | " BoundMethod " | " pyre_dump " | " reveal_type " | " reveal_locals " | " __build_class__ " | " __builtins__ " | " __debug__ " | " __dict__ " | " __doc__ " | " __file__ " | " __import__ " | " __loader__ " | " __name__ " | " __package__ " | " __path__ " | " __spec__ " | " Ar... |
module M = struct type t = Ojs . t let rec t_of_js : Ojs . t -> t = fun ( x2 : Ojs . t ) t -> x2 and t_to_js : t -> Ojs . t = fun ( x1 : Ojs . t ) t -> x1 let ( prop_get_arg : t -> int ) int = ( ( fun ( x3 : t ) t -> Ojs . int_of_js ( Ojs . get_prop_ascii ( t_to_js x3 ) x3 " propGetArg ) ) " [ @ ocaml . ppwarning " Heu... |
let test_global _ = let assert_global ~ expected source_text = let { Source . statements ; _ } = Test . parse ~ handle " : test . py " source_text in match statements with | [ { Node . value = Statement . Statement . Define define ; _ } ] -> let { Scope . globals ; _ } = Scope . of_define_exn define in let expected = L... |
let test_nonlocal _ = let assert_nonlocal ~ expected source_text = let { Source . statements ; _ } = Test . parse ~ handle " : test . py " source_text in match statements with | [ { Node . value = Statement . Statement . Define define ; _ } ] -> let { Scope . nonlocals ; _ } = Scope . of_define_exn define in let expect... |
module ExpectBinding = struct type t = { kind : Binding . Kind . t ; location : Location . t ; } let create kind location = { kind ; location } end |
let assert_binding ~ expected ~ actual name = match actual , expected with | None , None -> ( ) | Some binding , None -> let message = Format . asprintf " Expected binding to not exist but found : % a " Sexp . pp_hum ( Binding . sexp_of_t binding ) in assert_failure message | None , Some _ -> let message = Format . asp... |
let location ( start_line , start_column ) ( stop_line , stop_column ) = { Location . start = { Location . line = start_line ; column = start_column } ; stop = { Location . line = stop_line ; column = stop_column } ; } |
let int_annotation start end_ = Node . create ( Expression . Expression . Name ( Expression . Name . Identifier " int " ) ) ~ location ( : location start end_ ) |
let str_annotation start end_ = Node . create ( Expression . Expression . Name ( Expression . Name . Identifier " str " ) ) ~ location ( : location start end_ ) |
let test_define_local_bindings _ = let assert_bindings ~ expected source_text = let { Source . statements ; _ } = Test . parse ~ handle " : test . py " source_text in match statements with | [ { Node . value = Statement . Statement . Define define ; _ } ] -> let scope = Scope . of_define_exn define in List . iter expec... |
let test_expression_local_bindings _ = let assert_bindings ~ expected source_text = let { Source . statements ; _ } = Test . parse ~ handle " : test . py " source_text in match statements with | [ { Node . value = Statement . Statement . Expression expression ; _ } ] -> let scope = Scope . of_expression_exn expression ... |
module LookupSite = struct type t = | Global | Define of Reference . t end |
module ExpectAccess = struct type t = { kind : Access . Kind . t ; binding : ExpectBinding . t ; } let create kind binding = { kind ; binding } end |
let assert_access ~ actual ~ expected name = match actual , expected with | None , None -> ( ) | Some access , None -> let message = Format . asprintf " Expected access to not exist but found : % a " Sexp . pp_hum ( Access . sexp_of_t access ) in assert_failure message | None , Some _ -> let message = Format . asprintf... |
let test_scope_stack_lookup _ = let assert_bindings ~ expected ~ site source_text = let source = Test . parse ~ handle " : test . py " source_text |> Preprocessing . populate_nesting_defines in let scope_stack = ScopeStack . create source in let scope_stack = match site with | LookupSite . Global -> scope_stack | Looku... |
let ( ) = " scope " >::: [ " globals " >:: test_global ; " nonlocals " >:: test_nonlocal ; " define_local_bindings " >:: test_define_local_bindings ; " expression_local_bindings " >:: test_expression_local_bindings ; " scope_stack_lookup " >:: test_scope_stack_lookup ; ] |> Test . run |
module Error = struct type error = | Evar of string | Enon_linear_pat of string | Enon_linear_record of string | Enon_linear_automaton of string | Enon_linear_forall of string | Eautomaton_with_mixed_transitions | Emissing_in_orpat of string exception Error of location * error let error loc kind = raise ( Error ( loc ,... |
module S = Set . Make ( struct type t = string let compare = String . compare end ) |
module Rename = struct type initialized = bool type value = { name : Zident . t ; mutable initialized : initialized } include ( Map . Make ( struct type t = string let compare = String . compare end ) ) let entry n = { name = n ; initialized = false } let initialize ( { initialized = s } as v ) = v . initialized <- tru... |
let emake loc desc = { ( Zaux . emake desc no_typ ) with Zelus . e_loc = loc } |
let eqmake loc desc = { ( Zaux . eqmake desc ) with Zelus . eq_loc = loc } |
let pmake loc desc = { ( Zaux . pmake desc no_typ ) with Zelus . p_loc = loc } |
let var loc x = emake loc ( Zelus . Elocal ( x ) ) |
let varpat loc x = pmake loc ( Zelus . Evarpat ( x ) ) |
let eblock eq_list = { Zelus . b_vars = [ ] ; Zelus . b_locals = [ ] ; Zelus . b_body = eq_list ; Zelus . b_loc = no_location ; Zelus . b_write = empty ; Zelus . b_env = Env . empty ; } |
let block_with_emit emit ( { Zelus . e_loc = loc } as e ) = { Zelus . b_vars = [ ] ; Zelus . b_locals = [ ] ; Zelus . b_body = [ emit e ] ; Zelus . b_loc = loc ; Zelus . b_write = empty ; Zelus . b_env = Env . empty ; } |
let block_with_result x eq_list = let loc = ( List . hd eq_list ) . Zelus . eq_loc in { Zelus . b_vars = [ { Zelus . vardec_name = x ; Zelus . vardec_default = None ; Zelus . b_locals = [ ] ; Zelus . b_body = eq_list ; Zelus . b_loc = loc ; Zelus . b_write = empty ; Zelus . b_env = Env . empty } |
let name_with_sort initialize loc env n = try let { Rename . name = m } as v = Rename . find n env in if initialize then v . Rename . initialized <- true ; m with | Not_found -> Error . error loc ( Error . Evar ( n ) ) |
let name loc env n = name_with_sort false loc env n |
let shortname = function | Name ( n ) -> n | Modname ( { id = id } ) -> id |
let longname = function | Name ( n ) -> Lident . Name ( n ) | Modname ( { qual = q ; id = id } ) -> Lident . Modname ( { Lident . qual = q ; Lident . id = id } ) |
let immediate = function | Zparsetree . Eint ( i ) -> Deftypes . Eint ( i ) | Zparsetree . Ebool ( b ) -> Deftypes . Ebool ( b ) | Zparsetree . Efloat ( f ) -> Deftypes . Efloat ( f ) | Zparsetree . Echar ( c ) -> Deftypes . Echar ( c ) | Zparsetree . Estring ( s ) -> Deftypes . Estring ( s ) | Zparsetree . Evoid -> De... |
let constant = function | Zparsetree . Cimmediate ( i ) -> Deftypes . Cimmediate ( immediate i ) | Zparsetree . Cglobal ( ln ) -> Deftypes . Cglobal ( longname ln ) |
let default = function | Zparsetree . Init ( c ) -> Zelus . Init ( constant c ) | Zparsetree . Default ( c ) -> Zelus . Default ( constant c ) |
let kind = function | S -> Zelus . S | A -> Zelus . A | AS -> Zelus . AS | AD -> Zelus . AD | C -> Zelus . C | D -> Zelus . D | P -> Zelus . P |
let rec types env ty = let desc = match ty . desc with | Etypevar ( n ) -> Zelus . Etypevar ( n ) | Etypetuple ( ty_list ) -> Zelus . Etypetuple ( List . map ( types env ) ty_list ) | Etypeconstr ( lname , ty_list ) -> Zelus . Etypeconstr ( longname lname , List . map ( types env ) ty_list ) | Etypefun ( k , n_opt , ty... |
let operator loc env = function | Eunarypre -> Zelus . Eunarypre | Efby -> Zelus . Efby | Eminusgreater -> Zelus . Eminusgreater | Eifthenelse -> Zelus . Eifthenelse | Eup -> Zelus . Eup | Einitial -> Zelus . Einitial | Edisc -> Zelus . Edisc | Etest -> Zelus . Etest | Eaccess -> Zelus . Eaccess | Eupdate -> Zelus . Eu... |
let rec build check_linear acc p = let rec build acc p = match p . desc with | Ewildpat | Econstpat _ | Econstr0pat _ -> acc | Econstr1pat ( _ , p_list ) | Etuplepat ( p_list ) -> build_list check_linear acc p_list | Evarpat ( n ) -> if check_linear then Error . error p . loc ( Error . Enon_linear_pat ( n ) ) else acc ... |
let rec build_equation_list defnames eq_list = List . fold_left build_equation defnames eq_list match eq . desc with | EQeq ( pat , _ ) -> build false defnames pat | EQemit ( n , _ ) | EQder ( n , _ , _ , _ ) | EQinit ( n , _ ) | EQnext ( n , _ , _ ) | EQpluseq ( n , _ ) -> if S . mem n defnames then defnames else S . ... |
let rec check_pattern env p = let desc = match p . desc with | Ewildpat -> Zelus . Ewildpat | Econstpat ( im ) -> Zelus . Econstpat ( immediate im ) | Econstr0pat ( ln ) -> Zelus . Econstr0pat ( longname ln ) | Econstr1pat ( ln , p_list ) -> Zelus . Econstr1pat ( longname ln , check_pattern_list env p_list ) | Etuplepa... |
let pattern env p = let acc = build true S . empty p in let env0 = Rename . make acc in let env = Rename . append env0 env in env0 , env , check_pattern env p let acc = build_list true S . empty p_list in let env0 = Rename . make acc in let env = Rename . append env0 env in let p_list = List . map ( check_pattern env )... |
let match_handler_list body env_pat env m_h_list = let handler { m_pat = p ; m_body = b } = let env_p , env , p = pattern env p in let b = body env_pat env b in { Zelus . m_pat = p ; Zelus . m_body = b ; Zelus . m_env = Rename . typ_env env_p ; Zelus . m_reset = false ; Zelus . m_zero = false } in List . map handler m_... |
let present_handler_list scondpat body env_pat env p_h_list = let handler { p_cond = scpat ; p_body = b } = let env_scpat , env , scpat = scondpat env scpat in let b = body env_pat env b in { Zelus . p_cond = scpat ; Zelus . p_body = b ; Zelus . p_env = Rename . typ_env env_scpat ; Zelus . p_zero = false } in List . ma... |
let state_handler_list loc scondpat block_body block_in_escape expression env_pat env s_h_list se_opt = let addname acc { desc = { s_state = statepat } } = match statepat . desc with | Estate0pat ( n ) | Estate1pat ( n , _ ) -> let m = Zident . fresh n in if Rename . mem n acc then Error . error statepat . loc ( Error ... |
let vardec ( env_n_m_list , vardec_list ) let m = Zident . fresh n in let d_opt = Zmisc . optional_map default d_opt in let c_opt = Zmisc . optional_map longname c_opt in let vardec = { Zelus . vardec_name = m ; Rename . add n ( Rename . entry m ) env_n_m_list , vardec :: vardec_list |
let block locals body env_pat env { desc = { b_vars = vardec_list ; b_locals = l_list ; b_body = b } ; loc = loc } = let env_n_m_list , vardec_list = List . fold_left vardec ( Rename . empty , [ ] ) vardec_list in let env_pat = Rename . append env_n_m_list env_pat in let env = Rename . append env_n_m_list env in let va... |
let rec expression env { desc = desc ; loc = loc } = let desc = match desc with | Econst ( i ) -> Zelus . Econst ( immediate i ) | Econstr0 ( lname ) -> Zelus . Econstr0 ( longname lname ) | Evar ( Name ( n ) ) -> begin try let { Rename . name = m } = Rename . find n env in Zelus . Elocal ( m ) with | Not_found -> Zaux... |
let rec type_decl { desc = desc ; loc = loc } = let desc = match desc with | Eabstract_type -> Zelus . Eabstract_type | Eabbrev ( ty ) -> Zelus . Eabbrev ( types Rename . empty ty ) | Evariant_type ( constr_decl_list ) -> Zelus . Evariant_type ( List . map constr_decl constr_decl_list ) | Erecord_type ( n_ty_list ) -> ... |
let type_decls n_params_typdecl_list = List . map ( fun ( n , pars , typdecl ) -> ( n , pars , type_decl typdecl ) ) n_params_typdecl_list |
let implementation imp = try let desc = match imp . desc with | Econstdecl ( n , is_static , e ) -> Zelus . Econstdecl ( n , is_static , expression Rename . empty e ) | Efundecl ( n , { f_kind = k ; f_atomic = is_atomic ; f_args = p_list ; let _ , env , p_list = pattern_list Rename . empty p_list in Zelus . Efundecl ( ... |
let implementation_list imp_list = Zmisc . iter implementation imp_list |
let interface interf = try let desc = match interf . desc with | Einter_open ( n ) -> Zelus . Einter_open ( n ) | Einter_typedecl ( n , params , tydecl ) -> Zelus . Einter_typedecl ( n , params , type_decl tydecl ) | Einter_constdecl ( n , typ ) -> Zelus . Einter_constdecl ( n , types Rename . empty typ ) in { Zelus . ... |
let interface_list inter_list = Zmisc . iter interface inter_list |
type systemd_askpassword_msg = { message : string ; socket : string ; error : bool } |
let random_char = let random_channel = open_in_bin " / dev / urandom " in let f ( ) = ( input_char random_channel ) in let rec _unbiased_modulo ( ~ f : unit -> char ) ( element_count : int ) : int = let r = int_of_char ( f ( ) ) in if 256 mod element_count = 0 then r mod element_count else begin if r < element_count th... |
let get1char ( ) : ( char ) = let termio = Unix . tcgetattr Unix . stdin in let ( ) = Unix . tcsetattr Unix . stdin Unix . TCSAFLUSH Unix . c_icanon = false ; Unix . c_echo = false ; Unix . c_echoe = false ; Unix . c_echok = false ; Unix . c_echonl = false } in let res = input_char ( in_channel_of_descr stdin ) in Unix... |
let display_layout ~ display ~ alphabet ~ remapped_alphabet ~ prompt = let linux_movehome = " \ x1b [ H \ x1b [ 2J " and kbd_color = " \ x1b [ 1 ; 33m " and key_color = " \ x1b [ 2 ; 31m " and clear_color = " \ x1b [ 39 ; 49 ; 21 ; 22 ; 24m " and qwerty_color = " \ x1b [ 4 ; 1 ; 33m " in let kbd_sep_upper = kbd_color ^... |
let fisher_yates_shuffle ~ random_char remapped = let swap arr i j = let temp = arr . [ i ] in Bytes . set arr i arr . [ j ] ; Bytes . set arr j temp in let l = Bytes . length remapped in for i = ( l - 1 ) downto 1 do let r = random_char ( i + 1 ) in swap remapped i r done ; remapped |
let display s = Printf . fprintf ( Unix . out_channel_of_descr Unix . stderr ) " % s " %! s |
let retrieve_key_entry ~ prompt = let linux_cls = " \ x1b [ 2J " and linux_save = " \ x1b [ ? 1049h " and linux_restore = " \ x1b [ ? 1049l \ x1b [ 0m " in let ( ) = display ( linux_save ^ linux_cls ) in let alphabet = " ( ) ~!@#$%^&* _ + QWERTYUIOP { } | ASDFGHJKL " :\ ZXCVBNM ` <>? 1234567890 -= qwertyuiop [ ] \\ asd... |
let systemd_askpassword ~ prompt reply_socket = let passphrase = retrieve_key_entry ~ prompt in let sock = Unix . ( socket PF_UNIX SOCK_DGRAM 0 ) in let ( ) = Unix . connect sock ( Unix . ADDR_UNIX reply_socket ) in let passphrase = " " + ^ passphrase in let _ = Unix . send sock passphrase 0 ( String . length passphras... |
let systemd_watch ~ event_list = let open Inotify in let inotify_fd = Inotify . create ( ) in let askpassword_dir = " / run / systemd / ask - password " / in let _ = Inotify . add_watch inotify_fd askpassword_dir [ S_Moved_to ; S_Close_write ] in let rec inotify_read ( ) = begin try Inotify . read inotify_fd with _ -> ... |
let handle_operation = function | Plaintext ( callback , prompt ) -> let ( ) = display prompt in callback ( ( input_line ( in_channel_of_descr stdin ) ) ) | Scrambled ( callback , prompt ) -> let passphrase = retrieve_key_entry ~ prompt in callback passphrase | Systemdwatch event_list -> systemd_watch ~ event_list |
let ( ) = let output s = Printf . fprintf ( Unix . out_channel_of_descr Unix . stdout ) " % s " %! s in let output_nl s = output ( s ^ " \ n " ) in let rec parse_cmdline_queue ( acc : scramlkb_operation list ) = function | ( hd :: tl ) -> let mode : scramlkb_operation = ( match hd with | " p " | " plain " | " c " | " c... |
let remove_alpha_postfix ( ( k , path ) , v ) = let rec pconvert = function | Oide_apply ( p1 , p2 ) -> Oide_apply ( pconvert p1 , pconvert p2 ) | Oide_dot ( p , n ) -> Oide_dot ( pconvert p , n ) | Oide_ident s as i -> match String . index s ' ' with | exception _ -> i | p -> Oide_ident ( String . sub s 0 p ) in ( ( k... |
let rec normalize_path p = match p with | Oide_ident _ -> p | Oide_apply ( p1 , Oide_ident _ ) -> Oide_apply ( normalize_path p1 , Oide_ident " x " ) | Oide_apply _ -> assert false | Oide_dot ( p , n ) -> Oide_dot ( normalize_path p , n ) |
let rec get_alias = function | Hump . Def { kind ; path = p } -> Some ( Data . Path ( kind , p ) ) | Prim n -> Some ( Data . Primitive n ) | Aliased ( _ , v ) -> get_alias v | Coerced ( v , _ ) -> get_alias v | LocNone -> None |
let combine_sig_hump sigs ( humps : Humpflat . ent list ) = let humps = map remove_alpha_postfix humps in let humps = Hashtbl . of_list 101 & map ( fun ( ( k , p ) , v ) -> ( k , normalize_path p ) , v ) humps in flip map sigs & fun ( ( k , p ) , v ) -> let p ' = normalize_path p in let vo = Hashtbl . find_opt humps ( ... |
let is_cached datfile stamp = if File . Test . _f datfile then let dat = Dat . load datfile in if dat . Dat . stamp = stamp then Some dat else None else None |
let package destdir p = let open Opamfind . Ocamlfind in let version = match p . Analyzed_group . packages with | [ ] -> assert false | p :: _ -> Package . version p . Analyzed . package in let n = p . Opamfind . Ocamlfind . Analyzed_group . name in let ms = Cm . traverse_packages p in let stamp = Cm . package_stamp ms... |
let packages datadir packs = let packs = match packs with | [ ] -> !! Package . ocamlfind_package_groups | _ -> filter ( fun apg -> mem apg . Opamfind . Ocamlfind . Analyzed_group . name packs ) !! Package . ocamlfind_package_groups in iter ( ignore *< package datadir ) packs |
let input_buffer = Buffer . create 16383 |
let input_function ic buf len = let len = input ic buf 0 len in Buffer . add_substring input_buffer buf 0 len ; len |
let output_buffer = Buffer . create 16383 |
let modified = ref false |
let modules = ref [ " Arg " ; " BigArray " ; " Buffer " ; " Condition " ; " Dbm " ; " Digest " ; " Dynlink " ; " Event " ; " Filename " ; " Format " ; " Gc " ; " Genlex " ; " Graphics " ; " Lexing " ; " Marshal " ; " Mutex " ; " Parsing " ; " Pervasives " ; " Queue " ; " Sort " ; " Stack " ; " Str " ; " Stream " ; " Sy... |
let stdlabels = [ " Array " ; " List " ; " String " ] |
let morelabels = [ " Hashtbl " ; " Map " ; " Set " ] |
let alllabels = ref false |
let noopen = ref false |
let convert_impl buffer = let input_pos = ref 0 in let copy_input stop = Buffer . add_substring output_buffer ( Buffer . contents input_buffer ) ! input_pos ( stop - ! input_pos ) ; input_pos := stop in let next_token ( ) = let token = Lexer301 . token buffer and start = Lexing . lexeme_start buffer and stop = Lexing .... |
type state = Out | Enter | In | Escape |
let convert_intf buffer = let input_pos = ref 0 in let copy_input stop = Buffer . add_substring output_buffer ( Buffer . contents input_buffer ) ! input_pos ( stop - ! input_pos ) ; input_pos := stop in let last = ref ( EOF , 0 , 0 ) in let state = ref Out in try while true do let token = Lexer301 . token buffer and st... |
let convert_file ~ intf name = let ic = open_in name in Buffer . clear input_buffer ; Buffer . clear output_buffer ; modified := false ; begin let convert = if intf then convert_intf else convert_impl in try convert ( Lexing . from_function ( input_function ic ) ) ; close_in ic with exn -> close_in ic ; raise exn end ;... |
let _ = let files = ref [ ] and intf = ref false and keepstd = ref false and keepmore = ref false in Arg . parse [ " - intf " , Arg . Set intf , " remove all non - optional labels from an interface ; \ n " ^ " other options are ignored " ; " - all " , Arg . Set alllabels , " remove all labels , possibly including optio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.