1- (** Bundled by bspack 08/24-16:25 *)
1+ (** Bundled by bspack 08/25-10:52 *)
22module String_map : sig
33#1 "string_map.mli"
44(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -1399,7 +1399,7 @@ val init : int -> (int -> 'a) -> 'a list
13991399val take : int -> 'a list -> 'a list * 'a list
14001400val try_take : int -> 'a list -> 'a list * int * 'a list
14011401
1402- val exclude_tail : 'a list -> 'a list
1402+ val exclude_tail : 'a list -> 'a * 'a list
14031403
14041404val filter_map2 : ('a -> 'b -> 'c option) -> 'a list -> 'b list -> 'c list
14051405
@@ -1463,6 +1463,8 @@ val ref_push : 'a -> 'a t -> unit
14631463
14641464val ref_pop : 'a t -> 'a
14651465
1466+ val rev_except_last : 'a list -> 'a list * 'a
1467+
14661468end = struct
14671469#1 "ext_list.ml"
14681470(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -1651,11 +1653,11 @@ let try_take n l =
16511653 l, arr_length, []
16521654 else Array.to_list (Array.sub arr 0 n ), n, (Array.to_list (Array.sub arr n (arr_length - n)))
16531655
1654- let exclude_tail (x : 'a list) : 'a list =
1656+ let exclude_tail (x : 'a list) =
16551657 let rec aux acc x =
16561658 match x with
16571659 | [] -> invalid_arg "Ext_list.exclude_tail"
1658- | [ _ ] -> List.rev acc
1660+ | [ x ] -> x, List.rev acc
16591661 | y0::ys -> aux (y0::acc) ys in
16601662 aux [] x
16611663
@@ -1800,6 +1802,14 @@ let ref_pop refs =
18001802 refs := rest ;
18011803 x
18021804
1805+ let rev_except_last xs =
1806+ let rec aux acc xs =
1807+ match xs with
1808+ | [ ] -> invalid_arg "Ext_list.rev_except_last"
1809+ | [ x ] -> acc ,x
1810+ | x :: xs -> aux (x::acc) xs in
1811+ aux [] xs
1812+
18031813end
18041814module Ast_comb : sig
18051815#1 "ast_comb.mli"
@@ -4267,7 +4277,9 @@ type t =
42674277
42684278
42694279
4270-
4280+ (**
4281+ return value is of [pval_type, pval_prim]
4282+ *)
42714283val handle_attributes_as_string :
42724284 Bs_loc.t ->
42734285 string ->
@@ -4276,6 +4288,7 @@ val handle_attributes_as_string :
42764288 string ->
42774289 Ast_core_type.t * string list
42784290
4291+
42794292val bs_external : string
42804293val to_string : t -> string
42814294val from_string : string -> t
@@ -26040,14 +26053,8 @@ let translate_ffi (ffi : Ast_external_attributes.ffi ) prim_name
2604026053 end
2604126054 | Js_send { name ; pipe = true ; splice = js_splice}
2604226055 -> (* splice should not happen *)
26043- let self, args =
26044- match List.rev args with
26045- | self :: args -> self, List.rev args
26046- | _ -> assert false in
26047- let self_type, arg_types =
26048- match List.rev arg_types with
26049- | self_type :: arg_types -> self_type, List.rev arg_types
26050- | _ -> assert false in
26056+ let self, args = Ext_list.exclude_tail args in
26057+ let self_type, arg_types = Ext_list.exclude_tail arg_types in
2605126058 let args = Ext_list.flat_map2_last (ocaml_to_js js_splice) arg_types args in
2605226059 E.call ~info:{arity=Full; call_info = Call_na} (E.dot self name) args
2605326060
0 commit comments